From cf50b4f614f08a5d4afc4dd39295ffd7787a10d6 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 1 Dec 2010 14:39:28 +0000 Subject: [PATCH] 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. --- cogl/cogl-pipeline.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/cogl/cogl-pipeline.c b/cogl/cogl-pipeline.c index 848b27faf..cd07f369e 100644 --- a/cogl/cogl-pipeline.c +++ b/cogl/cogl-pipeline.c @@ -5721,22 +5721,21 @@ layers_codegen_would_differ (CoglPipelineLayer **pipeline0_layers, _cogl_pipeline_layer_compare_differences (layer0, layer1); if (layer_differences & codegen_modifiers) - { - /* When it comes to texture differences the only thing that - * affects the codegen is the target enum... */ - if (layer_differences == COGL_PIPELINE_LAYER_STATE_TEXTURE) - { - CoglHandle tex0 = _cogl_pipeline_layer_get_texture (layer0); - CoglHandle tex1 = _cogl_pipeline_layer_get_texture (layer1); - GLenum gl_target0; - GLenum gl_target1; + return TRUE; - cogl_texture_get_gl_texture (tex0, NULL, &gl_target0); - cogl_texture_get_gl_texture (tex1, NULL, &gl_target1); - if (gl_target0 == gl_target1) - continue; - } - return TRUE; + /* When it comes to texture differences the only thing that + * affects the codegen is the target enum... */ + if ((layer_differences & COGL_PIPELINE_LAYER_STATE_TEXTURE)) + { + CoglHandle tex0 = _cogl_pipeline_layer_get_texture (layer0); + CoglHandle tex1 = _cogl_pipeline_layer_get_texture (layer1); + GLenum gl_target0; + GLenum gl_target1; + + cogl_texture_get_gl_texture (tex0, NULL, &gl_target0); + cogl_texture_get_gl_texture (tex1, NULL, &gl_target1); + if (gl_target0 != gl_target1) + return TRUE; } }