cogl-vertex-buffer: Fix disabling the texture arrays from previous prim

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
This commit is contained in:
Neil Roberts 2010-01-26 13:46:27 +00:00
parent f288eae0fc
commit 92a375ab47

View File

@ -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;