summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2011-11-17 16:35:23 +0000
committerNeil Roberts <neil@linux.intel.com>2011-11-24 13:23:00 +0000
commit9e52b4d714a34be13a69847a03fc178ff0ea81de (patch)
tree214b3f28267d2a9a8612aacd585e9bfe093b97cd
parent80a9c3bb32a7efb2715cd4f4856b9c5e2a47cb0e (diff)
downloadcogl-9e52b4d714a34be13a69847a03fc178ff0ea81de.tar.gz
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>
-rw-r--r--cogl/cogl-pipeline-state.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cogl/cogl-pipeline-state.c b/cogl/cogl-pipeline-state.c
index 8f7eefa3..88bf1531 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;
}