From 92a375ab47296a81d739ca29b0972c7abe6eda16 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 26 Jan 2010 13:46:27 +0000 Subject: [PATCH] cogl-vertex-buffer: Fix disabling the texture arrays from previous prim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When setting up the state for the vertex buffer, enable_state_for_drawing_buffer tries to keep track of the highest numbered texture unit in use. It then disables any texture arrays for units that were previously enabled if they are greater than that number. However if there is no texturing in the VBO then the max used unit would be left at 0 which it would later think meant unit 0 is still in use so it wouldn't disable it. To fix this it now initialises the max used unit to -1 which it should interpret as ‘no units are in use’ so it will later disable the arrays for all units. Thanks to Jon Mayo for reporting the bug. http://bugzilla.openedhand.com/show_bug.cgi?id=1957 --- clutter/cogl/cogl/cogl-vertex-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/cogl/cogl/cogl-vertex-buffer.c b/clutter/cogl/cogl/cogl-vertex-buffer.c index 26d09ce01..5ced90abe 100644 --- a/clutter/cogl/cogl/cogl-vertex-buffer.c +++ b/clutter/cogl/cogl/cogl-vertex-buffer.c @@ -1512,7 +1512,7 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer) GLuint generic_index = 0; #endif gulong enable_flags = 0; - guint max_texcoord_attrib_unit = 0; + guint max_texcoord_attrib_unit = -1; const GList *layers; guint32 fallback_layers = 0; guint32 disable_layers = ~0;