From 44431da16430ba0f69f0b4c78f3d4fe148e2eaed Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 3 Feb 2010 14:31:12 +0000 Subject: [PATCH] cogl-vertex-buffer: Refix disabling texture coord arrays Commit 92a375ab4 changed the initial value of max_texcoord_attrib_unit to -1 so that it could disable the texture coord array for the first texture unit when there are no texture coords used in the vbo. However max_texcoord_attrib_unit was an unsigned value so this actually became G_MAXUINT. The disabling loop at the bottom still worked because G_MAXUINT+1==0 but the check for whether any texture unit is greater than max_texcoord_attrib_unit was failing so it would always end up disabling all texture units. This is now fixed by changing max_texcoord_attrib_unit to be signed. --- cogl/cogl-vertex-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogl/cogl-vertex-buffer.c b/cogl/cogl-vertex-buffer.c index 5ced90abe..ff2d2841e 100644 --- a/cogl/cogl-vertex-buffer.c +++ b/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 = -1; + gint max_texcoord_attrib_unit = -1; const GList *layers; guint32 fallback_layers = 0; guint32 disable_layers = ~0;