cogl: Set the layer matrix on the right layer instead of a random one

When uploading the layer matrix to GL it wasn't first calling
glActiveTextureMatrix to set the right texture unit for the
layer. This would end up setting the texture matrix on whatever layer
happened to be previously active. This happened to work for
test-cogl-multitexture presumably because it was coincidentally
setting the layer matrix on the last used layer.
This commit is contained in:
Neil Roberts 2011-02-09 15:24:43 +00:00
parent 94bcb4429b
commit b3a0bdf7f6
2 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,8 @@ _cogl_pipeline_vertend_fixed_add_layer (CoglPipeline *pipeline,
_cogl_matrix_stack_set (unit->matrix_stack,
&authority->big_state->matrix);
_cogl_set_active_texture_unit (unit_index);
_cogl_matrix_stack_flush_to_gl (unit->matrix_stack, COGL_MATRIX_TEXTURE);
}

View File

@ -271,6 +271,8 @@ _cogl_pipeline_vertend_glsl_add_layer (CoglPipeline *pipeline,
_cogl_matrix_stack_set (unit->matrix_stack,
&authority->big_state->matrix);
_cogl_set_active_texture_unit (unit_index);
_cogl_matrix_stack_flush_to_gl (unit->matrix_stack, COGL_MATRIX_TEXTURE);
}