Switch texture units before calling _cogl_texture_set_filters()
When setting up the state for a layer, we need to switch texture units before we do anything that might bind the texture, or we'll bind the wrong texture to the previous unit. http://bugzilla.openedhand.com/show_bug.cgi?id=2033 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
66e0f18753
commit
913c187f4e
@ -1402,6 +1402,12 @@ _cogl_material_flush_layers_gl_state (CoglMaterial *material,
|
|||||||
GLenum gl_target;
|
GLenum gl_target;
|
||||||
CoglTextureUnit *unit;
|
CoglTextureUnit *unit;
|
||||||
|
|
||||||
|
/* Switch units first so we don't disturb the previous unit if
|
||||||
|
* something needs to bind the texture temporarily */
|
||||||
|
GE (glActiveTexture (GL_TEXTURE0 + i));
|
||||||
|
|
||||||
|
unit = _cogl_get_texture_unit (i);
|
||||||
|
|
||||||
_cogl_material_layer_ensure_mipmaps (layer_handle);
|
_cogl_material_layer_ensure_mipmaps (layer_handle);
|
||||||
|
|
||||||
new_gl_layer_info.layer0_overridden =
|
new_gl_layer_info.layer0_overridden =
|
||||||
@ -1447,9 +1453,6 @@ _cogl_material_flush_layers_gl_state (CoglMaterial *material,
|
|||||||
cogl_texture_get_gl_texture (tex_handle, &gl_texture, NULL);
|
cogl_texture_get_gl_texture (tex_handle, &gl_texture, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
GE (glActiveTexture (GL_TEXTURE0 + i));
|
|
||||||
unit = _cogl_get_texture_unit (i);
|
|
||||||
|
|
||||||
/* FIXME: We could be more clever here and only bind the texture
|
/* FIXME: We could be more clever here and only bind the texture
|
||||||
if it is different from gl_layer_info->gl_texture to avoid
|
if it is different from gl_layer_info->gl_texture to avoid
|
||||||
redundant GL calls. However a few other places in Cogl and
|
redundant GL calls. However a few other places in Cogl and
|
||||||
|
Loading…
Reference in New Issue
Block a user