User avatar
ajstarks
Posts: 129
Joined: Fri Jun 22, 2012 2:14 am

Optimizing OpenGL initialization

Wed Aug 15, 2012 1:12 am

The code on this OpenVG library: https://github.com/ajstarks/openvg/blob ... /oglinit.c was cribbed from the classic tiger demo. It works but I suspect it can be optimized. OpenGL experts: how can this be improved?

pwinwood
Posts: 78
Joined: Mon Jul 02, 2012 2:21 am
Location: Oxford, England

Re: Optimizing OpenGL initialization

Wed Aug 15, 2012 7:24 am

If I recall correctly - I don't have the source in front of me to check - the code does some OpenGL ES initialization which is not necessary. It can all be done using OpenVG, but then again as the graphics processor is running OpenVG and OpenGL ES it probably does not harm at all.

blu
Posts: 55
Joined: Tue Jul 17, 2012 9:57 pm

Re: Optimizing OpenGL initialization

Wed Aug 15, 2012 7:33 am

Hey, ajstarks

Your version seems already fairly short to me. Here's what I do in my little test suite, but that includes a few more things when choosing a config (like selecting RGB bitness, MSAA and depth buffering, or even directly selecting a config by id), and some portions of the routine are clearly candidates for their own subroutines, but I haven't bothered to move them out:
http://code.google.com/p/test-es/source ... cm.cpp#301

ps: cool openvg test app!

pps: in case you are curious about the test suite, it's multi-platform, and a work-in-progress. The only test-case app that currently works on the Pi (Raspbian) is the sans_shadows one; the skeleton test also builds but is having issues with the skinning vertex shader (Dom suggested the compiler might be running out of registers, which does seem to be the case).

Return to “OpenGLES”