[Cogl] [PATCH] Fix multiple snippet interlieving bug

Plamena Manolova plamena.n.manolova at intel.com
Wed Mar 20 07:25:19 PDT 2013


Interlieving multiple snippets with different hooks
(COGL_SNIPPET_HOOK_VERTEX and COGL_SNIPPET_HOOK_VERTEX_TRANSFORM,
for instance) used to cause a bug during shader code generation.
---
 cogl/cogl-pipeline-snippet.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cogl/cogl-pipeline-snippet.c b/cogl/cogl-pipeline-snippet.c
index 0e0f620..8bfa8be 100644
--- a/cogl/cogl-pipeline-snippet.c
+++ b/cogl/cogl-pipeline-snippet.c
@@ -100,7 +100,7 @@ _cogl_pipeline_snippet_generate_code (const CoglPipelineSnippetData *data)
 
   for (snippet = first_snippet, snippet_num = 0;
        snippet_num < n_snippets;
-       snippet = COGL_LIST_NEXT (snippet, list_node), snippet_num++)
+       snippet = COGL_LIST_NEXT (snippet, list_node))
     if (snippet->snippet->hook == data->hook)
       {
         const char *source;
@@ -180,6 +180,7 @@ _cogl_pipeline_snippet_generate_code (const CoglPipelineSnippetData *data)
                                   data->return_variable);
 
         g_string_append (data->source_buf, "}\n");
+        snippet_num++;
       }
 }
 
-- 
1.8.1.2

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the Cogl mailing list