From de8276105f34b480dee0b2044debe001c25710ac Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 9 Aug 2010 15:06:35 -0400 Subject: [PATCH] Always bind a new texture to unit 1 when necessary The special handling for texture unit 1 caught the case where unit 1 was changed for transient purposes, but didn't properly handle the case where the actual non-transient texture was different between two materials with no transient binding in between. If the actual texture has changed when flushing, mark unit 1 as dirty and needing a rebind. http://bugzilla.clutter-project.org/show_bug.cgi?id=2261 --- clutter/cogl/cogl/cogl-material-opengl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clutter/cogl/cogl/cogl-material-opengl.c b/clutter/cogl/cogl/cogl-material-opengl.c index 51a8288af..9283bb683 100644 --- a/clutter/cogl/cogl/cogl-material-opengl.c +++ b/clutter/cogl/cogl/cogl-material-opengl.c @@ -737,7 +737,9 @@ flush_layers_common_gl_state_cb (CoglMaterialLayer *layer, void *user_data) */ if (unit->gl_texture != gl_texture || unit->is_foreign) { - if (unit_index != 1) + if (unit_index == 1) + unit->dirty_gl_texture = TRUE; + else GE (glBindTexture (gl_target, gl_texture)); unit->gl_texture = gl_texture; }