Jump to content
  • Advertisement
Sign in to follow this  
Prune

glGetError

This topic is 1476 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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!