pipeline: don't dereference NULL program state

This avoid dereferencing a NULL arbfp program state in
_cogl_pipeline_backend_arbfp_layer_pre_change_notify for
_STATE_COMBINE_CONSTANT changes.
This commit is contained in:
Robert Bragg 2010-12-08 18:57:42 +00:00
parent 46295a0dd1
commit cf1fced885

View File

@ -1087,10 +1087,14 @@ _cogl_pipeline_backend_arbfp_layer_pre_change_notify (
if (change & COGL_PIPELINE_LAYER_STATE_COMBINE_CONSTANT)
{
ArbfpProgramState *arbfp_program_state =
get_arbfp_program_state (owner);
ArbfpProgramState *arbfp_program_state = get_arbfp_program_state (owner);
if (arbfp_program_state)
{
int unit_index = _cogl_pipeline_layer_get_unit_index (layer);
arbfp_program_state->unit_state[unit_index].dirty_combine_constant = TRUE;
arbfp_program_state->unit_state[unit_index].dirty_combine_constant =
TRUE;
}
}
/* TODO: we could be saving snippets of texture combine code along