Рет қаралды 256
*WARNING, RAPIDLY CHANGING IMAGES MAY TRIGGER SOME*
This really isn't anything particularly useful or interesting, just showing off some performance scaling some quads using vitaGL & CG Shaders. Special thanks to Rinnegatamante for not only *making* vitaGL but being very patient and answering my many questions. You guys should really support him and all the amazing work he does for the Vita community.
The renderer was created with the idea of not using any legacy OpenGL functions. The matrix math is handled by a port of cglm and is quite performant (I believe it's being compiled with math-neon support, as is vitaGL). Instead of draw calls immediately drawing to the screen, they're queued into a small array (about 0.15mb fully allocated) and OpenGL is given the data offsets & stride.
After this is when it gets a bit inefficient. I needed the renderer to handle lots of state changes, so each quad is being drawn with its own glDrawArrays call. I'm also not using an IBO due to the need to make these state changes.
Though quite fast because the data is already on the GPU, lots of rapid state changes can make TheXTech crawl to 17-20 FPS. The solution to this may be dynamically atlas-ing the loaded textures, but this is an exercise for another time. Proper atlasing of all these small textures on a 4096x4096 texture buffer would allow me to use IBOs and draw everything in one fell swoop.
github.com/suicvne
github.com/suicvne/vitaGL_sha...
github.com/Rinnegatamante/vitaGL
github.com/Rinnegatamante
github.com/suicvne/cglm_vita
github.com/recp/cglm