i965: pass indirect buffer to primitive restart check
authorChris Forbes <chrisf@ijw.co.nz>
Sat, 21 Sep 2013 05:41:14 +0000 (17:41 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 25 Nov 2013 09:01:35 +0000 (22:01 +1300)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_draw.h
src/mesa/drivers/dri/i965/brw_primitive_restart.c

index 15cc6e37bd06806b6bea27bf3c1986344d1705eb..8a170f80aac284a2d2a45e5841eeb5ceaeb974b9 100644 (file)
@@ -376,7 +376,8 @@ static bool brw_try_draw_prims( struct gl_context *ctx,
                                     GLuint nr_prims,
                                     const struct _mesa_index_buffer *ib,
                                     GLuint min_index,
-                                    GLuint max_index )
+                                    GLuint max_index,
+                                    struct gl_buffer_object *indirect)
 {
    struct brw_context *brw = brw_context(ctx);
    bool retval = true;
@@ -528,7 +529,7 @@ void brw_draw_prims( struct gl_context *ctx,
       return;
 
    /* Handle primitive restart if needed */
-   if (brw_handle_primitive_restart(ctx, prims, nr_prims, ib)) {
+   if (brw_handle_primitive_restart(ctx, prims, nr_prims, ib, indirect)) {
       /* The draw was handled, so we can exit now */
       return;
    }
@@ -559,7 +560,7 @@ void brw_draw_prims( struct gl_context *ctx,
     * manage it.  swrast doesn't support our featureset, so we can't fall back
     * to it.
     */
-   brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index);
+   brw_try_draw_prims(ctx, arrays, prims, nr_prims, ib, min_index, max_index, indirect);
 }
 
 void brw_draw_init( struct brw_context *brw )
index 119d6f16f7e4803043f902e112b2a359a971c58f..9f95aab27d7464013a0e1de0cc2d4ece866dd45b 100644 (file)
@@ -52,6 +52,7 @@ GLboolean
 brw_handle_primitive_restart(struct gl_context *ctx,
                              const struct _mesa_prim *prims,
                              GLuint nr_prims,
-                             const struct _mesa_index_buffer *ib);
+                             const struct _mesa_index_buffer *ib,
+                             struct gl_buffer_object *indirect);
 
 #endif
index a1311510daf676483e669bc13275c50c806834cb..3748e74f782ad3871fda1c2627b70b9213f1d0be 100644 (file)
@@ -129,7 +129,8 @@ GLboolean
 brw_handle_primitive_restart(struct gl_context *ctx,
                              const struct _mesa_prim *prims,
                              GLuint nr_prims,
-                             const struct _mesa_index_buffer *ib)
+                             const struct _mesa_index_buffer *ib,
+                             struct gl_buffer_object *indirect)
 {
    struct brw_context *brw = brw_context(ctx);
 
@@ -169,7 +170,7 @@ brw_handle_primitive_restart(struct gl_context *ctx,
       /* Cut index should work for primitive restart, so use it
        */
       brw->prim_restart.enable_cut_index = true;
-      brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL, NULL);
+      brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL, indirect);
       brw->prim_restart.enable_cut_index = false;
    } else {
       /* Not all the primitive draw modes are supported by the cut index,