vbo: pass the stream from DrawTransformFeedbackStream to drivers
authorMarek Olšák <marek.olsak@amd.com>
Thu, 30 Jul 2015 13:43:09 +0000 (15:43 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 6 Aug 2015 18:11:43 +0000 (20:11 +0200)
Reviewed-by: Dave Airlie <airlied@redhat.com>
19 files changed:
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/brw_draw.h
src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
src/mesa/drivers/dri/i965/brw_primitive_restart.c
src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
src/mesa/state_tracker/st_cb_rasterpos.c
src/mesa/state_tracker/st_draw.c
src/mesa/state_tracker/st_draw.h
src/mesa/state_tracker/st_draw_feedback.c
src/mesa/tnl/t_draw.c
src/mesa/tnl/tnl.h
src/mesa/vbo/vbo.h
src/mesa/vbo/vbo_exec_array.c
src/mesa/vbo/vbo_exec_draw.c
src/mesa/vbo/vbo_primitive_restart.c
src/mesa/vbo/vbo_rebase.c
src/mesa/vbo/vbo_save_draw.c
src/mesa/vbo/vbo_split_copy.c
src/mesa/vbo/vbo_split_inplace.c

index 9113d0f5a8edb81910bbbc3f62912c4a2717dc63..e092ef4a7c6ad0f4dcf529741607517e3da11702 100644 (file)
@@ -559,6 +559,7 @@ brw_draw_prims(struct gl_context *ctx,
                GLuint min_index,
                GLuint max_index,
                struct gl_transform_feedback_object *unused_tfb_object,
+               unsigned stream,
                struct gl_buffer_object *indirect)
 {
    struct brw_context *brw = brw_context(ctx);
@@ -584,7 +585,7 @@ brw_draw_prims(struct gl_context *ctx,
       _swsetup_Wakeup(ctx);
       _tnl_wakeup(ctx);
       _tnl_draw_prims(ctx, prims, nr_prims, ib,
-                      index_bounds_valid, min_index, max_index, NULL, NULL);
+                      index_bounds_valid, min_index, max_index, NULL, 0, NULL);
       return;
    }
 
index fc83dcdd0bbd666be60bbd4581fc7b8aa3519415..f994726f5b68f8b0ed594eefc6e3864bcd092ed3 100644 (file)
@@ -34,7 +34,7 @@
 struct brw_context;
 
 
-void brw_draw_prims( struct gl_context *ctx,
+void brw_draw_prims(struct gl_context *ctx,
                     const struct _mesa_prim *prims,
                     GLuint nr_prims,
                     const struct _mesa_index_buffer *ib,
@@ -42,6 +42,7 @@ void brw_draw_prims( struct gl_context *ctx,
                     GLuint min_index,
                     GLuint max_index,
                     struct gl_transform_feedback_object *unused_tfb_object,
+                     unsigned stream,
                     struct gl_buffer_object *indirect );
 
 void brw_draw_init( struct brw_context *brw );
index e7e8df5bdeda493d695c6b2d8803c6933a7e7d94..f5ecbb5498981f02e0986fa6ebe80dd93b9eec89 100644 (file)
@@ -200,7 +200,7 @@ brw_draw_rectlist(struct gl_context *ctx, struct rect *rect, int num_instances)
 
    brw_draw_prims(ctx, &prim, 1, NULL,
                   GL_TRUE, start, start + count - 1,
-                  NULL, NULL);
+                  NULL, 0, NULL);
 }
 
 static void
index 2c7a7e8b8dd5483a6806e23e450743a218f995ff..6ed79d7cb753b18e98a9acb1f85c09f3ded0786e 100644 (file)
@@ -161,7 +161,8 @@ 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, indirect);
+      brw_draw_prims(ctx, prims, nr_prims, ib, GL_FALSE, -1, -1, NULL, 0,
+                     indirect);
       brw->prim_restart.enable_cut_index = false;
    } else {
       /* Not all the primitive draw modes are supported by the cut index,
index c85acec12680a2f2889185c4896170d76f9083c3..a3fbad07e66c1d1166a5452bdb34640c71824055 100644 (file)
@@ -223,6 +223,7 @@ TAG(vbo_render_prims)(struct gl_context *ctx,
                      GLboolean index_bounds_valid,
                      GLuint min_index, GLuint max_index,
                      struct gl_transform_feedback_object *tfb_vertcount,
+                      unsigned stream,
                      struct gl_buffer_object *indirect);
 
 static GLboolean
@@ -455,6 +456,7 @@ TAG(vbo_render_prims)(struct gl_context *ctx,
                      GLboolean index_bounds_valid,
                      GLuint min_index, GLuint max_index,
                      struct gl_transform_feedback_object *tfb_vertcount,
+                      unsigned stream,
                      struct gl_buffer_object *indirect)
 {
        struct nouveau_render_state *render = to_render_state(ctx);
@@ -492,6 +494,7 @@ TAG(vbo_check_render_prims)(struct gl_context *ctx,
                            GLboolean index_bounds_valid,
                            GLuint min_index, GLuint max_index,
                            struct gl_transform_feedback_object *tfb_vertcount,
+                            unsigned stream,
                            struct gl_buffer_object *indirect)
 {
        struct nouveau_context *nctx = to_nouveau_context(ctx);
@@ -501,12 +504,12 @@ TAG(vbo_check_render_prims)(struct gl_context *ctx,
        if (nctx->fallback == HWTNL)
                TAG(vbo_render_prims)(ctx, prims, nr_prims, ib,
                                      index_bounds_valid, min_index, max_index,
-                                     tfb_vertcount, indirect);
+                                     tfb_vertcount, stream, indirect);
 
        if (nctx->fallback == SWTNL)
                _tnl_draw_prims(ctx, prims, nr_prims, ib,
                                index_bounds_valid, min_index, max_index,
-                               tfb_vertcount, indirect);
+                               tfb_vertcount, stream, indirect);
 }
 
 void
index 272cbb91d52fa955395b365eea3c660af89cf985..b9997dacfd27e2eca50480465adae93e2160335c 100644 (file)
@@ -254,7 +254,7 @@ st_RasterPos(struct gl_context *ctx, const GLfloat v[4])
     * st_feedback_draw_vbo doesn't check for that flag. */
    ctx->Array._DrawArrays = rs->arrays;
    st_feedback_draw_vbo(ctx, &rs->prim, 1, NULL, GL_TRUE, 0, 1,
-                        NULL, NULL);
+                        NULL, 0, NULL);
    ctx->Array._DrawArrays = saved_arrays;
 
    /* restore draw's rasterization stage depending on rendermode */
index bae8096e080cb7200dd104c92425b3f623bb7d05..a29971c484a9d5fecf0b9f59f0854cd1c5f28dec 100644 (file)
@@ -184,6 +184,7 @@ st_draw_vbo(struct gl_context *ctx,
             GLuint min_index,
             GLuint max_index,
             struct gl_transform_feedback_object *tfb_vertcount,
+            unsigned stream,
             struct gl_buffer_object *indirect)
 {
    struct st_context *st = st_context(ctx);
index 780d4bde71360f4a7711d8334077c62faa49b6b2..a973c8a4a5d9b2e2c161a018391e4d4713e1583e 100644 (file)
@@ -56,6 +56,7 @@ st_draw_vbo(struct gl_context *ctx,
             GLuint min_index,
             GLuint max_index,
             struct gl_transform_feedback_object *tfb_vertcount,
+            unsigned stream,
             struct gl_buffer_object *indirect);
 
 extern void
@@ -67,6 +68,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
                      GLuint min_index,
                      GLuint max_index,
                      struct gl_transform_feedback_object *tfb_vertcount,
+                     unsigned stream,
                      struct gl_buffer_object *indirect);
 
 /**
index 177f6b5aefa242907f2db6b9163458b6bcfd604d..88c10a8f1501f6113e6a55b40210fdf9fb29dd6d 100644 (file)
@@ -117,6 +117,7 @@ st_feedback_draw_vbo(struct gl_context *ctx,
                      GLuint min_index,
                      GLuint max_index,
                      struct gl_transform_feedback_object *tfb_vertcount,
+                     unsigned stream,
                      struct gl_buffer_object *indirect)
 {
    struct st_context *st = st_context(ctx);
index 632acb55f8bc1a8ae3b3b56dfbfb5bdec5ab55c1..c130ab3f93d119ef68ba258d94e2f6167137b336 100644 (file)
@@ -425,6 +425,7 @@ void _tnl_draw_prims(struct gl_context *ctx,
                         GLuint min_index,
                         GLuint max_index,
                         struct gl_transform_feedback_object *tfb_vertcount,
+                         unsigned stream,
                         struct gl_buffer_object *indirect)
 {
    TNLcontext *tnl = TNL_CONTEXT(ctx);
index 8c59ff9e58f9dba759e3ba61591a3126c163b70a..5a9938e7afb267ada627726b37d9654768d19fac 100644 (file)
@@ -76,7 +76,7 @@ struct _mesa_prim;
 struct _mesa_index_buffer;
 
 void
-_tnl_draw_prims( struct gl_context *ctx,
+_tnl_draw_prims(struct gl_context *ctx,
                     const struct _mesa_prim *prim,
                     GLuint nr_prims,
                     const struct _mesa_index_buffer *ib,
@@ -84,6 +84,7 @@ _tnl_draw_prims( struct gl_context *ctx,
                     GLuint min_index,
                     GLuint max_index,
                     struct gl_transform_feedback_object *tfb_vertcount,
+                     unsigned stream,
                     struct gl_buffer_object *indirect );
 
 extern void
index 54dee6c464ffbbbf3208fdd8226a258e058e9ff4..2aaff5df0198b98a67c1e5a22f046883fdff43e6 100644 (file)
@@ -97,7 +97,8 @@ typedef void (*vbo_draw_func)( struct gl_context *ctx,
                               GLuint min_index,
                               GLuint max_index,
                               struct gl_transform_feedback_object *tfb_vertcount,
-                              struct gl_buffer_object *indirect );
+                               unsigned stream,
+                              struct gl_buffer_object *indirect);
 
 
 
index ec13449c7518f4357cde38ca91330368e7ab9151..34d2c1d3d6ba3e330b8534ee3382d716b7299cb4 100644 (file)
@@ -633,7 +633,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
          /* draw one or two prims */
          check_buffers_are_unmapped(exec->array.inputs);
          vbo->draw_prims(ctx, prim, primCount, NULL,
-                         GL_TRUE, start, start + count - 1, NULL, NULL);
+                         GL_TRUE, start, start + count - 1, NULL, 0, NULL);
       }
    }
    else {
@@ -644,7 +644,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start,
       check_buffers_are_unmapped(exec->array.inputs);
       vbo->draw_prims(ctx, prim, 1, NULL,
                       GL_TRUE, start, start + count - 1,
-                      NULL, NULL);
+                      NULL, 0, NULL);
    }
 
    if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
@@ -990,7 +990,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
 
    check_buffers_are_unmapped(exec->array.inputs);
    vbo->draw_prims(ctx, prim, 1, &ib,
-                   index_bounds_valid, start, end, NULL, NULL);
+                   index_bounds_valid, start, end, NULL, 0, NULL);
 
    if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
       _mesa_flush(ctx);
@@ -1350,7 +1350,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
 
       check_buffers_are_unmapped(exec->array.inputs);
       vbo->draw_prims(ctx, prim, primcount, &ib,
-                      false, ~0, ~0, NULL, NULL);
+                      false, ~0, ~0, NULL, 0, NULL);
    } else {
       /* render one prim at a time */
       for (i = 0; i < primcount; i++) {
@@ -1379,7 +1379,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
 
          check_buffers_are_unmapped(exec->array.inputs);
          vbo->draw_prims(ctx, prim, 1, &ib,
-                         false, ~0, ~0, NULL, NULL);
+                         false, ~0, ~0, NULL, 0, NULL);
       }
    }
 
@@ -1464,7 +1464,7 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode,
 
    check_buffers_are_unmapped(exec->array.inputs);
    vbo->draw_prims(ctx, prim, 1, NULL,
-                   GL_TRUE, 0, 0, obj, NULL);
+                   GL_TRUE, 0, 0, obj, stream, NULL);
 
    if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) {
       _mesa_flush(ctx);
@@ -1563,7 +1563,7 @@ vbo_validated_drawarraysindirect(struct gl_context *ctx,
    check_buffers_are_unmapped(exec->array.inputs);
    vbo->draw_prims(ctx, prim, 1,
                    NULL, GL_TRUE, 0, ~0,
-                   NULL,
+                   NULL, 0,
                    ctx->DrawIndirectBuffer);
 
    if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH)
@@ -1603,7 +1603,7 @@ vbo_validated_multidrawarraysindirect(struct gl_context *ctx,
    check_buffers_are_unmapped(exec->array.inputs);
    vbo->draw_prims(ctx, prim, primcount,
                    NULL, GL_TRUE, 0, ~0,
-                   NULL,
+                   NULL, 0,
                    ctx->DrawIndirectBuffer);
 
    free(prim);
@@ -1640,7 +1640,7 @@ vbo_validated_drawelementsindirect(struct gl_context *ctx,
    check_buffers_are_unmapped(exec->array.inputs);
    vbo->draw_prims(ctx, prim, 1,
                    &ib, GL_TRUE, 0, ~0,
-                   NULL,
+                   NULL, 0,
                    ctx->DrawIndirectBuffer);
 
    if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH)
@@ -1689,7 +1689,7 @@ vbo_validated_multidrawelementsindirect(struct gl_context *ctx,
    check_buffers_are_unmapped(exec->array.inputs);
    vbo->draw_prims(ctx, prim, primcount,
                    &ib, GL_TRUE, 0, ~0,
-                   NULL,
+                   NULL, 0,
                    ctx->DrawIndirectBuffer);
 
    free(prim);
index 37b53a8309d51e0661696b18e983f72fb843f2c7..2bfb0c32b73d6bc59e807866f1e838e3f866a0d2 100644 (file)
@@ -412,7 +412,7 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped)
                                       GL_TRUE,
                                       0,
                                       exec->vtx.vert_count - 1,
-                                      NULL, NULL);
+                                      NULL, 0, NULL);
 
         /* If using a real VBO, get new storage -- unless asked not to.
           */
index dafc4fd2a9aca80e4bbdad5ae224b5ddb4b95c15..0662c5cd4ef47c5039a42882114f8247860d5949 100644 (file)
@@ -251,11 +251,11 @@ vbo_sw_primitive_restart(struct gl_context *ctx,
                 (temp_prim.count == sub_prim->count)) {
                draw_prims_func(ctx, &temp_prim, 1, ib,
                                GL_TRUE, sub_prim->min_index, sub_prim->max_index,
-                               NULL, NULL);
+                               NULL, 0, NULL);
             } else {
                draw_prims_func(ctx, &temp_prim, 1, ib,
                                GL_FALSE, -1, -1,
-                               NULL, NULL);
+                               NULL, 0, NULL);
             }
          }
          if (sub_end_index >= end_index) {
index c3c4b64e65cfd8d82d76c3f89d8dec463752c904..24c04ca7e6a612507454cfe3b6da65e8cd5b3855 100644 (file)
@@ -258,7 +258,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
         GL_TRUE,
         0, 
         max_index - min_index,
-        NULL, NULL );
+        NULL, 0, NULL );
 
    ctx->Array._DrawArrays = saved_arrays;
    ctx->NewDriverState |= ctx->DriverFlags.NewArray;
index de744e0c763264ed096e41ca2518da3b384d341b..b1fd6892026e6f78b83c422342e146ae2ca5765b 100644 (file)
@@ -314,7 +314,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data)
                                       GL_TRUE,
                                       0,    /* Node is a VBO, so this is ok */
                                       node->count - 1,
-                                      NULL, NULL);
+                                      NULL, 0, NULL);
       }
    }
 
index 7b1e20b18d256e550e1d04149f65dfbf6ad7e5c8..cb27ef961ab6c4fbf763a3bb023de3a5f78950a4 100644 (file)
@@ -203,7 +203,7 @@ flush( struct copy_context *copy )
               GL_TRUE,
               0,
               copy->dstbuf_nr - 1,
-              NULL, NULL );
+              NULL, 0, NULL );
 
    ctx->Array._DrawArrays = saved_arrays;
    ctx->NewDriverState |= ctx->DriverFlags.NewArray;
index 5887b74d8298cb832fa38cd9a6a12cfefe47cb97..cff4bcd30ff3de4fa06de6c38c43921ced233871 100644 (file)
@@ -94,7 +94,7 @@ static void flush_vertex( struct split_context *split )
               !split->ib,
               split->min_index,
               split->max_index,
-              NULL, NULL);
+              NULL, 0, NULL);
 
    ctx->Array._DrawArrays = saved_arrays;
    ctx->NewDriverState |= ctx->DriverFlags.NewArray;