diff --git a/cogl/cogl-pipeline-fragend-arbfp.c b/cogl/cogl-pipeline-fragend-arbfp.c index f02aec296..813bf1442 100644 --- a/cogl/cogl-pipeline-fragend-arbfp.c +++ b/cogl/cogl-pipeline-fragend-arbfp.c @@ -61,6 +61,7 @@ typedef struct _UnitState { int constant_id; /* The program.local[] index */ unsigned int dirty_combine_constant:1; + unsigned int has_combine_constant:1; unsigned int sampled:1; } UnitState; @@ -404,6 +405,7 @@ setup_arg (CoglPipeline *pipeline, UnitState *unit_state = &shader_state->unit_state[unit_index]; unit_state->constant_id = shader_state->next_constant_id++; + unit_state->has_combine_constant = TRUE; unit_state->dirty_combine_constant = TRUE; arg->type = COGL_PIPELINE_FRAGEND_ARBFP_ARG_TYPE_CONSTANT; @@ -786,7 +788,8 @@ update_constants_cb (CoglPipeline *pipeline, _COGL_GET_CONTEXT (ctx, FALSE); - if (state->update_all || unit_state->dirty_combine_constant) + if (unit_state->has_combine_constant && + (state->update_all || unit_state->dirty_combine_constant)) { float constant[4]; _cogl_pipeline_get_layer_combine_constant (pipeline,