cogl-pipeline: Fix the codgen authority for texture target changes

When determining if a layer would require a different shader to be
generated it needs to check a certain set of state changes and it
needs to check whether the texture target is different. However it was
checking whether texture texture was different only if the other state
was also different which doesn't make any sense. It also only checked
the texture difference if that was the only state change which meant
that effectively the code was impossible to reach. Now it does the
texture target check indepent of the other state changes.
This commit is contained in:
Neil Roberts 2010-12-01 14:39:28 +00:00
parent a38fa7a2df
commit f620d53054

View File

@ -5721,10 +5721,11 @@ layers_codegen_would_differ (CoglPipelineLayer **pipeline0_layers,
_cogl_pipeline_layer_compare_differences (layer0, layer1); _cogl_pipeline_layer_compare_differences (layer0, layer1);
if (layer_differences & codegen_modifiers) if (layer_differences & codegen_modifiers)
{ return TRUE;
/* When it comes to texture differences the only thing that /* When it comes to texture differences the only thing that
* affects the codegen is the target enum... */ * affects the codegen is the target enum... */
if (layer_differences == COGL_PIPELINE_LAYER_STATE_TEXTURE) if ((layer_differences & COGL_PIPELINE_LAYER_STATE_TEXTURE))
{ {
CoglHandle tex0 = _cogl_pipeline_layer_get_texture (layer0); CoglHandle tex0 = _cogl_pipeline_layer_get_texture (layer0);
CoglHandle tex1 = _cogl_pipeline_layer_get_texture (layer1); CoglHandle tex1 = _cogl_pipeline_layer_get_texture (layer1);
@ -5733,9 +5734,7 @@ layers_codegen_would_differ (CoglPipelineLayer **pipeline0_layers,
cogl_texture_get_gl_texture (tex0, NULL, &gl_target0); cogl_texture_get_gl_texture (tex0, NULL, &gl_target0);
cogl_texture_get_gl_texture (tex1, NULL, &gl_target1); cogl_texture_get_gl_texture (tex1, NULL, &gl_target1);
if (gl_target0 == gl_target1) if (gl_target0 != gl_target1)
continue;
}
return TRUE; return TRUE;
} }
} }