Sign in to follow this  

glGetError

This topic is 1189 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Will I get a significant performance hit if I call glGetError() per frame, even if just before the SwapBuffers call (and I'm using vsync)?

 

For example, if I have a persistently mapped buffer, and I've initiated a transfer, then does the glGetError() act like a barrier and would thus potentially be a significant hit?

Edited by Prune

Share this post


Link to post
Share on other sites

Not really, as its something the driver just sets once and forgets. In a release build you should check everywhere during init and then at opportune places in the renderer (then disable it after first error).

In debug builds just check everywhere you think it will help, such as after rendering particles etc. as it will help you get started narrowing down bugs.

Edited by Kaptein

Share this post


Link to post
Share on other sites

Calling glGetError() will give some performance hit. Most GL drivers nowadays are threaded - when you call glDoTheThing(), the call and its arguments are pushed to a queue which is executed by another thread. By calling glGetError(), you force a sync point in the driver so it has to wait for the GL command to finish before the error can be read.

 

You can make use of the debug output functions which can report errors asynchronously, which shouldn't give as much of a performance hit.

Share this post


Link to post
Share on other sites

This topic is 1189 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this