View Full Version : State changes in OpenGL

10-21-2015, 11:41 PM
How does state changes in OpenGL impacts the performance or makes it slower?

Alfonse Reinheart
10-22-2015, 06:21 AM
I'm not sure I understand the question. Are you asking about the mechanism by which a state change impacts performance? That is, what the CPU and/or GPU is doing that makes it slower?

10-22-2015, 08:20 AM
Yes you are right. Let's say if we enable depth test or disable it, what is done in the driver which makes the application to run slower?
If we bind different texture or buffer, is it only loading of different data which makes it slower or anything else?

Alfonse Reinheart
10-22-2015, 10:15 AM
Every state change has its own costs and mechanisms that impair performance. You may as well be asking "what does the driver do when I call an OpenGL function?" And the question isn't even hardware neutral; on some hardware, certain kinds of state changes impair performance more than other hardware.

There is no complete or even semi-complete answer someone could give without going through each kind of state one by one.