[Mesa-dev] [PATCH 1/3] vbo: pass the stream from DrawTransformFeedbackStream to drivers
Marek Olšák
maraeo at gmail.com
Thu Jul 30 07:26:06 PDT 2015
From: Marek Olšák <marek.olsak at amd.com>
---
src/mesa/drivers/dri/i965/brw_draw.c | 3 ++-
src/mesa/drivers/dri/i965/brw_draw.h | 3 ++-
src/mesa/drivers/dri/i965/brw_meta_fast_clear.c | 2 +-
src/mesa/drivers/dri/i965/brw_primitive_restart.c | 3 ++-
src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c | 7 +++++--
src/mesa/state_tracker/st_cb_rasterpos.c | 2 +-
src/mesa/state_tracker/st_draw.c | 1 +
src/mesa/state_tracker/st_draw.h | 2 ++
src/mesa/state_tracker/st_draw_feedback.c | 1 +
src/mesa/tnl/t_draw.c | 1 +
src/mesa/tnl/tnl.h | 3 ++-
src/mesa/vbo/vbo.h | 3 ++-
src/mesa/vbo/vbo_exec_array.c | 20 ++++++++++----------
src/mesa/vbo/vbo_exec_draw.c | 2 +-
src/mesa/vbo/vbo_primitive_restart.c | 4 ++--
src/mesa/vbo/vbo_rebase.c | 2 +-
src/mesa/vbo/vbo_save_draw.c | 2 +-
src/mesa/vbo/vbo_split_copy.c | 2 +-
src/mesa/vbo/vbo_split_inplace.c | 2 +-
19 files changed, 39 insertions(+), 26 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index b5ef276..efc4f40 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -561,6 +561,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 )
{
struct brw_context *brw = brw_context(ctx);
@@ -586,7 +587,7 @@ void 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;
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h
index fc83dcd..f994726 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.h
+++ b/src/mesa/drivers/dri/i965/brw_draw.h
@@ -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 );
diff --git a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
index e7e8df5..f5ecbb5 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_fast_clear.c
@@ -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
diff --git a/src/mesa/drivers/dri/i965/brw_primitive_restart.c b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
index 2c7a7e8..6ed79d7 100644
--- a/src/mesa/drivers/dri/i965/brw_primitive_restart.c
+++ b/src/mesa/drivers/dri/i965/brw_primitive_restart.c
@@ -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,
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
index c85acec..a3fbad0 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_vbo_t.c
@@ -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
diff --git a/src/mesa/state_tracker/st_cb_rasterpos.c b/src/mesa/state_tracker/st_cb_rasterpos.c
index 272cbb9..b9997da 100644
--- a/src/mesa/state_tracker/st_cb_rasterpos.c
+++ b/src/mesa/state_tracker/st_cb_rasterpos.c
@@ -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 */
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index 66b2f83..78dd5f4 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -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);
diff --git a/src/mesa/state_tracker/st_draw.h b/src/mesa/state_tracker/st_draw.h
index 780d4bd..a973c8a 100644
--- a/src/mesa/state_tracker/st_draw.h
+++ b/src/mesa/state_tracker/st_draw.h
@@ -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);
/**
diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c
index 177f6b5..88c10a8 100644
--- a/src/mesa/state_tracker/st_draw_feedback.c
+++ b/src/mesa/state_tracker/st_draw_feedback.c
@@ -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);
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 632acb5..c130ab3 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -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);
diff --git a/src/mesa/tnl/tnl.h b/src/mesa/tnl/tnl.h
index 8c59ff9..5a9938e 100644
--- a/src/mesa/tnl/tnl.h
+++ b/src/mesa/tnl/tnl.h
@@ -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
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
index 54dee6c..2aaff5d 100644
--- a/src/mesa/vbo/vbo.h
+++ b/src/mesa/vbo/vbo.h
@@ -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);
diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
index ec13449..34d2c1d 100644
--- a/src/mesa/vbo/vbo_exec_array.c
+++ b/src/mesa/vbo/vbo_exec_array.c
@@ -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);
diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c
index 37b53a8..2bfb0c3 100644
--- a/src/mesa/vbo/vbo_exec_draw.c
+++ b/src/mesa/vbo/vbo_exec_draw.c
@@ -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.
*/
diff --git a/src/mesa/vbo/vbo_primitive_restart.c b/src/mesa/vbo/vbo_primitive_restart.c
index dafc4fd..0662c5c 100644
--- a/src/mesa/vbo/vbo_primitive_restart.c
+++ b/src/mesa/vbo/vbo_primitive_restart.c
@@ -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) {
diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c
index c3c4b64..24c04ca 100644
--- a/src/mesa/vbo/vbo_rebase.c
+++ b/src/mesa/vbo/vbo_rebase.c
@@ -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;
diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c
index de744e0..b1fd689 100644
--- a/src/mesa/vbo/vbo_save_draw.c
+++ b/src/mesa/vbo/vbo_save_draw.c
@@ -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);
}
}
diff --git a/src/mesa/vbo/vbo_split_copy.c b/src/mesa/vbo/vbo_split_copy.c
index 7b1e20b..cb27ef9 100644
--- a/src/mesa/vbo/vbo_split_copy.c
+++ b/src/mesa/vbo/vbo_split_copy.c
@@ -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;
diff --git a/src/mesa/vbo/vbo_split_inplace.c b/src/mesa/vbo/vbo_split_inplace.c
index 5887b74..cff4bcd 100644
--- a/src/mesa/vbo/vbo_split_inplace.c
+++ b/src/mesa/vbo/vbo_split_inplace.c
@@ -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;
--
2.1.4
More information about the mesa-dev
mailing list