cogl-pipeline: Fix comparing layer states for finding codgen authority

When compiling for GLES2, the codegen is affected by state other than
the layers. That means when we find an authority for the codegen state
we can't directly look at authority->n_layers to determine the number
of layers because it isn't necessarily the layer state authority. This
patch changes it to use cogl_pipeline_get_n_layers instead. Once we
have two authorities that differ in codegen state we then compare all
of the layers to decide if they would affect codegen. However it was
ignoring the fact that the authorities might also differ by the other
codegen state. This path also adds an extra check for whether
_cogl_pipeline_compare_differences contains any codegen bits other
than COGL_PIPELINE_STATE_LAYERS.
This commit is contained in:
Neil Roberts 2010-12-01 15:48:37 +00:00
parent cf50b4f614
commit d2326d497a

View File

@ -5859,13 +5859,20 @@ _cogl_pipeline_find_codegen_authority (CoglPipeline *pipeline,
else
return authority0;
n_layers = authority0->n_layers;
n_layers = cogl_pipeline_get_n_layers (authority0);
for (;;)
{
AddLayersToArrayState state;
if (authority0->n_layers != authority1->n_layers)
if (n_layers != cogl_pipeline_get_n_layers (authority1))
return authority0;
/* If the programs differ by anything that isn't part of the
layer state then we can't continue */
if ((codegen_state & ~COGL_PIPELINE_STATE_LAYERS) &&
(_cogl_pipeline_compare_differences (authority0, authority1) &
(codegen_state & ~COGL_PIPELINE_STATE_LAYERS)))
return authority0;
authority0_layers =