An in memory cache of the OpenGL state.
State changes can be particularly expensive time wise. This is because a change requires OpenGL to re-evaluate and update the state machine. Because of the general purpose nature of OGRE we often set the state for a specific texture, material, buffer, etc. But this may be the same as the current status of the state machine and is therefore redundant and causes unnecessary work to be performed by OpenGL.
Instead we are caching the state so that we can check whether it actually does need to be updated. This leads to improved performance all around and can be somewhat dramatic in some cases.
- Warning
- caching does not work with multiple windows, sharing the same context. They will erroneously get different state caches.