matrix-stack: Adds a stack age counter
authorRobert Bragg <robert@linux.intel.com>
Fri, 10 Dec 2010 11:13:09 +0000 (11:13 +0000)
committerNeil Roberts <neil@linux.intel.com>
Mon, 13 Dec 2010 17:28:29 +0000 (17:28 +0000)
commit4976d229405c7010a6ef1e621bcfb581b7eff99a
tree2e5fcdce32c0ac23727a1a09948eaaf45a96ba58
parent856d43a27cd4090467de08cd5738f10ec7e06ebd
matrix-stack: Adds a stack age counter

Sometimes it would be useful if we could efficiently track when a matrix
stack has been modified. For example on GLES2 we have to upload the
modelview as a uniform to our glsl programs but because the modelview
state is part of the framebuffer state it becomes a bit more tricky to
know when to re-sync the value of the uniform with the framebuffer
state. This adds an "age" counter to CoglMatrixStack which is
incremented for any operation that effectively modifies the top of the
stack so now we can save the age of the stack inside the pipeline
whenever we update modelview uniform and later compare that with the
stack to determine if it has changed.
clutter/cogl/cogl/cogl-matrix-stack.c
clutter/cogl/cogl/cogl-matrix-stack.h