i965/draw: Use the correct buffer index for interleaved VBO sizes
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 24 May 2016 23:57:38 +0000 (16:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 25 May 2016 03:50:35 +0000 (20:50 -0700)
The buffer_range_* arrays are indexed by buffer index not element index.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_draw_upload.c

index 3349161754bde311cf07070fa33bb033926faefb..f4d1b2c6af10af7da9417d1204e08145a9b74fe8 100644 (file)
@@ -529,8 +529,10 @@ brw_prepare_vertices(struct brw_context *brw)
               input->buffer = brw->vb.enabled[k]->buffer;
               input->offset = glarray->Ptr - other->Ptr;
 
-               buffer_range_start[k] = MIN2(buffer_range_start[k], start);
-               buffer_range_end[k] = MAX2(buffer_range_end[k], start + range);
+               buffer_range_start[input->buffer] =
+                  MIN2(buffer_range_start[input->buffer], start);
+               buffer_range_end[input->buffer] =
+                  MAX2(buffer_range_end[input->buffer], start + range);
               break;
            }
         }