[cogl] Fix comparing the uniforms state



commit 9e52b4d714a34be13a69847a03fc178ff0ea81de
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.
    
    Reviewed-by: Robert Bragg <robert linux intel com>

 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]