Making Redundant OpenGL Calls

I was wondering if it is recommended to eliminate all redundant opengl calls.

For example, should I do something like (wrapped in a function):

if(foobuffer != boundbuffer) { glBindBuffer(GL_BAR_BUFFER, foobuffer); boundbuffer = foobuffer; } 

Or does the driver automatically perform such actions, and is it really redundant re-checking?

+6
c ++ buffer call opengl driver
source share
2 answers

You should probably avoid this. Here (in particular, 22.040, you will have to scroll down the page because there is no binding for it), it is noted that redundant calls are usually bad although some implementations try to minimize the impact.

Tools like gDEBugger can be used to track where you could make redundant calls, if you are in a position you don't know how much code you can make in your database.

+5
source share

I just eliminated many of these calls from the Android application, so I can tell you that this is important on this platform (on this particular OS version and hardware). This increased the frame rate by several frames per second, I would say about a profit of 5-10%.

+3
source share

All Articles