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>
This commit is contained in:
Neil Roberts 2011-11-17 16:35:23 +00:00
parent 80a9c3bb32
commit 9e52b4d714

View File

@ -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;
}