I wonder what happens when functions that change OpenGL states, ex glBindVertexArray
or glBindTexture
are called with the same parameter multiple times in a row like below?
//like this
glBindVertexArray(vao);
glBindVertexArray(vao);
glBindTexture(GL_TEXTURE_2D, tbo);
glBindTexture(GL_TEXTURE_2D, tbo);
//or like this
glBindVertexArray(vao);
glBindTexture(GL_TEXTURE_2D, tbo);
glBindVertexArray(vao);
glBindTexture(GL_TEXTURE_2D, tbo);
We know that state changes are costly. But if the new state is the same as the old one is performance overhead the same as if the two states where different? Or does OpenGL perform conditional check and ignore the second state change command?