progend-glsl: dirty prog for vertex state changes

_cogl_pipeline_progend_glsl_pre_change_notify and
_cogl_pipeline_progend_glsl_layer_pre_change_notify were only dirtying
the current program state for changes related to fragment processing.

This make both functions also check for changes that affect vertex
shader codegen.

This also fixes a mistake where
_cogl_pipeline_progend_glsl_layer_pre_change_notify was checking for
non-layer related changes which would never be seen, and instead it
should be checking for layer based changes only.
This commit is contained in:
Robert Bragg 2013-01-19 15:36:25 +00:00
parent 7fa04bb1a6
commit 56ae6f9afa

View File

@ -830,8 +830,11 @@ _cogl_pipeline_progend_glsl_pre_change_notify (CoglPipeline *pipeline,
{ {
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
if ((change & _cogl_pipeline_get_state_for_fragment_codegen (ctx))) if ((change & (_cogl_pipeline_get_state_for_fragment_codegen (ctx) |
dirty_program_state (pipeline); COGL_PIPELINE_STATE_AFFECTS_VERTEX_CODEGEN)))
{
dirty_program_state (pipeline);
}
else else
{ {
int i; int i;
@ -866,13 +869,12 @@ _cogl_pipeline_progend_glsl_layer_pre_change_notify (
{ {
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
if ((change & _cogl_pipeline_get_state_for_fragment_codegen (ctx))) if ((change & (_cogl_pipeline_get_layer_state_for_fragment_codegen (ctx) |
COGL_PIPELINE_LAYER_STATE_AFFECTS_VERTEX_CODEGEN)))
{ {
dirty_program_state (owner); dirty_program_state (owner);
return;
} }
else if (change & COGL_PIPELINE_LAYER_STATE_COMBINE_CONSTANT)
if (change & COGL_PIPELINE_LAYER_STATE_COMBINE_CONSTANT)
{ {
CoglPipelineProgramState *program_state = get_program_state (owner); CoglPipelineProgramState *program_state = get_program_state (owner);
if (program_state) if (program_state)
@ -881,8 +883,7 @@ _cogl_pipeline_progend_glsl_layer_pre_change_notify (
program_state->unit_state[unit_index].dirty_combine_constant = TRUE; program_state->unit_state[unit_index].dirty_combine_constant = TRUE;
} }
} }
else if (change & COGL_PIPELINE_LAYER_STATE_USER_MATRIX)
if (change & COGL_PIPELINE_LAYER_STATE_USER_MATRIX)
{ {
CoglPipelineProgramState *program_state = get_program_state (owner); CoglPipelineProgramState *program_state = get_program_state (owner);
if (program_state) if (program_state)