Views: 1,526,836 Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 07-25-24 04:37 AM

0 users reading ctrulib GPU API status | 1 bot

Main - Homebrew discussion - ctrulib GPU API status Hide post layouts | New reply

Posted on 11-15-14 12:34 AM Link | #21
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

Posted on 11-27-14 01:36 PM Link | #32
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.014 seconds. (2048KB of memory used)
MySQL - queries: 26, rows: 65/65, time: 0.007 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.