From: Neil Roberts Date: Mon, 2 Feb 2009 22:01:47 +0000 (+0000) Subject: [cogl-texture] Fix the count for the number of enabled arrays X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49359407b0b1e4c56d2af56cbb62e8d855c58812;p=profile%2Fivi%2Fclutter.git [cogl-texture] Fix the count for the number of enabled arrays The quad drawing code keeps track of the number of texture units that have the tex coord array enabled so that in the next call it can disabled any that are no longer enabled. However it was using 'i+1' as the count but 'i' is already set to 'n_layers' from the previous for loop. Therefore it was disabling an extra texture unit. This doesn't normally matter but it was causing GLES 2 to pointlessly realize an extra unit. --- diff --git a/clutter/cogl/gles/cogl-texture.c b/clutter/cogl/gles/cogl-texture.c index 777b500..3bb622a 100644 --- a/clutter/cogl/gles/cogl-texture.c +++ b/clutter/cogl/gles/cogl-texture.c @@ -2149,7 +2149,7 @@ _cogl_journal_flush_quad_batch (CoglJournalEntry *batch_start, } prev_n_texcoord_arrays_enabled = ctx->n_texcoord_arrays_enabled; - ctx->n_texcoord_arrays_enabled = i + 1; + ctx->n_texcoord_arrays_enabled = i; for (; i < prev_n_texcoord_arrays_enabled; i++) { GE (glClientActiveTexture (GL_TEXTURE0 + i));