cogl-pipeline-glsl: Fix reusing shaders for shared ancestors
authorNeil Roberts <neil@linux.intel.com>
Thu, 2 Dec 2010 16:30:55 +0000 (16:30 +0000)
committerNeil Roberts <neil@linux.intel.com>
Thu, 2 Dec 2010 16:36:00 +0000 (16:36 +0000)
commitdd5431ef382a59337cfda04bc31cebc28085f17f
tree244924b4e25214de1a4157e7a8f5b893588dfd10
parent4cfe90bde275dbb952645397aa2ba2d6f6e2f3ba
cogl-pipeline-glsl: Fix reusing shaders for shared ancestors

The check for whether we can reuse a program we've already generated
was only being done if the pipeline already had a
glsl_program_state. When there is no glsl_program_state it then looks
for the nearest ancestor it can share the program with. It then
wasn't checking whether that ancestor already had a GL program so it
would start generating the source again. It wouldn't however compile
that source again because _cogl_pipeline_backend_glsl_end does check
whether there is already a program. This patch moves the check until
after it has found the glsl_program_state, whether or not it was found
from an ancestor or as its own state.
clutter/cogl/cogl/cogl-pipeline-glsl.c