Views: 1,610,090 | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 11-23-24 02:17 PM |
Guest: |
0 users reading ctrulib GPU API status | 1 bot |
Main - Homebrew discussion - ctrulib GPU API status | Hide post layouts | New reply |
StapleButter |
| ||
Member blarg Level: 30 Posts: 18/184 EXP: 151401 Next: 14468 Since: 10-27-14 From: France Last post: 2650 days ago Last view: 2560 days ago |
I guess the way we're going with the low-level GPU API s not the best way.
Those functions can't just be used anywhere, there is an order to them, and that order isn't always obvious. By being modelled after the PICA200 commands, the API is full of oddities. To name a few: * GPU_FinishDrawing() -- still not quite clear when exactly it must be called (best thing to do is to try with and without it) * GPU_SetDepthTestAndWriteMask() -- because the same command does both depth test stuff and color/depth write masks, we get such a weirdass name * GPU_SetBlendingColor() must be called after GPU_SetStencilOp() -- because the GPU freezes if command 0x0106 isn't followed by 0x0103, even if they are unrelated * GPU_SetScissorTest() -- the commands that set scissor test boundaries are already called in the middle of GPU_SetViewport(), which is problematic when trying to use GPU_SetScissorTest() Long story short, the PICA200 is a weird GPU. If we don't accomodate to that in the best way possible, the code will be a nightmare to manage. What they do in official code is store all the GPU configuration somewhere, and only send all the configuration in the correct order whenever geometry has to be drawn. There are some exceptions, but this is how most things are handled. I believe we need to think for a while and make the low-level GPU API more sane before we try to build more stuff (like the planned OpenGL implementation) on top of it. Eventually anything will be a pain if we continue in this weird way. Doing things like they do in official code would help cut down on weirdness. ____________________ blargSNES -- SNES emu for 3DS More cool stuff |
minexew |
| ||
Newcomer Normal user Level: 6 Posts: 1/6 EXP: 887 Next: 20 Since: 11-27-14 Last post: 3643 days ago Last view: 3641 days ago |
I have already given up on ctrulib's GPU_ functions and now I'm only using them as reference for writing my own OpenGL implementation. |
Main - Homebrew discussion - ctrulib GPU API status | Hide post layouts | New reply |
Page rendered in 0.011 seconds. (2048KB of memory used) MySQL - queries: 26, rows: 65/65, time: 0.005 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |