i965: Implement all_varyings_in_vbos in terms of Array._DrawVAO.
authorMathias Fröhlich <mathias.froehlich@web.de>
Sun, 1 Apr 2018 18:18:36 +0000 (20:18 +0200)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Thu, 10 May 2018 05:06:16 +0000 (07:06 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
src/mesa/drivers/dri/i965/brw_draw.c

index 25ba372c449c178c214ac7f07e986a828219b486..c5f04264fad2c7bef79bb2925d7f4c44c627a32b 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <sys/errno.h>
 
+#include "main/arrayobj.h"
 #include "main/blend.h"
 #include "main/context.h"
 #include "main/condrender.h"
@@ -917,20 +918,6 @@ retry:
 }
 
 
-static bool
-all_varyings_in_vbos(const struct gl_vertex_array *arrays)
-{
-   GLuint i;
-
-   for (i = 0; i < VERT_ATTRIB_MAX; i++)
-      if (arrays[i].BufferBinding->Stride &&
-          arrays[i].BufferBinding->BufferObj->Name == 0)
-         return false;
-
-   return true;
-}
-
-
 
 void
 brw_draw_prims(struct gl_context *ctx,
@@ -982,7 +969,7 @@ brw_draw_prims(struct gl_context *ctx,
     * get the minimum and maximum of their index buffer so we know what range
     * to upload.
     */
-   if (!index_bounds_valid && !all_varyings_in_vbos(arrays)) {
+   if (!index_bounds_valid && _mesa_draw_user_array_bits(ctx) != 0) {
       perf_debug("Scanning index buffer to compute index buffer bounds.  "
                  "Use glDrawRangeElements() to avoid this.\n");
       vbo_get_minmax_indices(ctx, prims, ib, &min_index, &max_index, nr_prims);