pipeline: differentiate texture target and data state
authorRobert Bragg <robert@linux.intel.com>
Tue, 11 Jan 2011 16:02:06 +0000 (16:02 +0000)
committerRobert Bragg <robert@linux.intel.com>
Thu, 13 Jan 2011 12:23:33 +0000 (12:23 +0000)
commit88a085fdd86e3f1f285833f2f4df19af339c339c
tree4c3c2d581c23a0553c2e54049c53bc7d2133809e
parent8ab68d26a5c2e026bc422da13ab290ba3d432aa4
pipeline: differentiate texture target and data state

There are several places where we need to compare the texture state of a
pipeline and sometimes we need to take into consideration if the
underlying texture has changed but other times we may only care to know
if the texture target has changed.

For example the fragends typically generate programs that they want to
share with all pipelines with equivalent fragment processing state, and
in this case when comparing pipelines we only care about the texture
targets since changes to the underlying texture won't affect the
programs generated.

Prior to this we had tried to handle this by passing around some special
flags to various functions that evaluate pipeline state to say when we
do/don't care about the texture data, but this wasn't working in all
cases and was more awkward to manage than the new approach.

Now we simply have two state bits:
COGL_PIPELINE_LAYER_STATE_TEXTURE_TARGET and
COGL_PIPELINE_LAYER_STATE_TEXTURE_DATA and CoglPipelineLayer has an
additional target member. Since all the appropriate code takes masks of
these state bits to determine what to evaluate we don't need any extra
magic flags.
clutter/cogl/cogl/cogl-pipeline-fragend-arbfp.c
clutter/cogl/cogl/cogl-pipeline-fragend-fixed.c
clutter/cogl/cogl/cogl-pipeline-fragend-glsl.c
clutter/cogl/cogl/cogl-pipeline-opengl.c
clutter/cogl/cogl/cogl-pipeline-private.h
clutter/cogl/cogl/cogl-pipeline-progend-glsl.c
clutter/cogl/cogl/cogl-pipeline-vertend-glsl.c
clutter/cogl/cogl/cogl-pipeline.c