Sign in to follow this  
Prune

A matter of state

Recommended Posts

Prune    224
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
Geometrian    1810
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

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