static CoglBool update_constants_cb (CoglPipeline *pipeline, int layer_index, void *user_data) { UpdateConstantsState *state = user_data; CoglPipelineShaderState *shader_state = state->shader_state; UnitState *unit_state = &shader_state->unit_state[state->unit++]; _COGL_GET_CONTEXT (ctx, FALSE); if (unit_state->has_combine_constant && (state->update_all || unit_state->dirty_combine_constant)) { float constant[4]; _cogl_pipeline_get_layer_combine_constant (pipeline, layer_index, constant); GE (ctx, glProgramLocalParameter4fv (GL_FRAGMENT_PROGRAM_ARB, unit_state->constant_id, constant)); unit_state->dirty_combine_constant = FALSE; } return TRUE; }
static void _cogl_program_flush_uniform_arbfp (GLint location, CoglBoxedValue *value) { _COGL_GET_CONTEXT (ctx, NO_RETVAL); if (value->type != COGL_BOXED_NONE) { g_return_if_fail (value->type == COGL_BOXED_FLOAT); g_return_if_fail (value->size == 4); g_return_if_fail (value->count == 1); GE( ctx, glProgramLocalParameter4fv (GL_FRAGMENT_PROGRAM_ARB, location, value->v.float_value) ); } }