Jump to content
  • Advertisement
Sign in to follow this  
Prune

A matter of state

This topic is 2804 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

I end up usually having a lot of rectangular 2D layers and most of the time, rather than having multiple VBOs, I use a single full screen quad VBO, a vertex shader that does _no_ transforms, and the only thing that changes is the texture and viewport. So my question is regarding the overhead of a moderate number of glViewport calls. How serious is it? Can I assume this function doesn't result in kernel mode call by the driver? For cases where some objects overlap exactly and the new coordinates are the same ones as the old: does the driver check whether there is a change or should I do such a check manually before calling glViewport to improve performance?

Share this post


Link to post
Share on other sites
Advertisement
Hi,

Whatever the case, glViewport(...) will not cause any serious overhead. If you're just looking at a few passes, worry about binding your shaders/textures a LOT more.

You may be better off not checking for state changes, although, as always, try to avoid it. If it's still a serious concern for you, you can always just benchmark your code with and without the checks.

-G

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!