[cogl/wip/neil/snippets: 1/4] Fix comparing the uniforms state



commit aa3ce3ac823ea169edb206ed3cbf497eb14efe28
Author: Neil Roberts <neil linux intel com>
Date:   Thu Nov 17 16:35:23 2011 +0000

    Fix comparing the uniforms state
    
    When comparing uniform values, it was not correctly handling the case
    where pipeline0 has the value set but pipeline1 does not (only the
    other way around) so it would crash.

 cogl/cogl-pipeline-state.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/cogl/cogl-pipeline-state.c b/cogl/cogl-pipeline-state.c
index 8f7eefa..88bf153 100644
--- a/cogl/cogl-pipeline-state.c
+++ b/cogl/cogl-pipeline-state.c
@@ -321,11 +321,16 @@ _cogl_pipeline_uniforms_state_equal (CoglPipeline *authority0,
       const CoglBoxedValue *value0 = values0[i];
       const CoglBoxedValue *value1 = values1[i];
 
-      if (value0 == NULL || value0->type == COGL_BOXED_NONE)
+      if (value0 == NULL)
         {
           if (value1 != NULL && value1->type != COGL_BOXED_NONE)
             return FALSE;
         }
+      else if (value1 == NULL)
+        {
+          if (value0 != NULL && value0->type != COGL_BOXED_NONE)
+            return FALSE;
+        }
       else if (!_cogl_boxed_value_equal (value0, value1))
         return FALSE;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]