summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_draw.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-04-05 14:29:37 +0200
committerMarek Olšák <[email protected]>2014-07-02 00:47:10 +0200
commitb97b87940b1f7e093325ece4c1dd97b1d56835a1 (patch)
treefeaa488ea3876f50c7eb6408a13490b8028a1575 /src/mesa/state_tracker/st_draw.c
parent59330f13b0a9adda9b14d695ca68b731c1c5abf6 (diff)
st/mesa: add support for indirect drawing
Diffstat (limited to 'src/mesa/state_tracker/st_draw.c')
-rw-r--r--src/mesa/state_tracker/st_draw.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index c8189faade5..64d6ef52514 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -244,6 +244,14 @@ st_draw_vbo(struct gl_context *ctx,
}
}
+ if (indirect) {
+ info.indirect = st_buffer_object(indirect)->buffer;
+
+ /* Primitive restart is not handled by the VBO module in this case. */
+ info.primitive_restart = ctx->Array._PrimitiveRestart;
+ info.restart_index = ctx->Array.RestartIndex;
+ }
+
/* do actual drawing */
for (i = 0; i < nr_prims; i++) {
info.mode = translate_prim(ctx, prims[i].mode);
@@ -256,6 +264,7 @@ st_draw_vbo(struct gl_context *ctx,
info.min_index = info.start;
info.max_index = info.start + info.count - 1;
}
+ info.indirect_offset = prims[i].indirect_offset;
if (ST_DEBUG & DEBUG_DRAW) {
debug_printf("st/draw: mode %s start %u count %u indexed %d\n",
@@ -265,7 +274,7 @@ st_draw_vbo(struct gl_context *ctx,
info.indexed);
}
- if (info.count_from_stream_output) {
+ if (info.count_from_stream_output || info.indirect) {
cso_draw_vbo(st->cso_context, &info);
}
else if (info.primitive_restart) {