summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-11-17 17:19:06 -0500
committerMarek Olšák <marek.olsak@amd.com>2021-01-04 19:22:33 -0500
commit05f35a50e3ad2b9e3e0dae1c4b1bed7c91908022 (patch)
treea663ba03826b9fd89d76312d33fd8fe4df0121d2 /src/gallium/drivers/llvmpipe/lp_draw_arrays.c
parent87b57aa30f5cb6069e23bbe1a2cfd558b1a119cd (diff)
gallium: remove and emulate PIPE_CAP_MULTI_DRAW
To remove PIPE_CAP checking in the common code. It's better if drivers lower multi draws even if the hardware doesn't support it beause the multi draw loop can be moved deeper into the driver to remove more overhead. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_draw_arrays.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_draw_arrays.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
index 1bcc7fd6f53..cd38ca9c7c6 100644
--- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
+++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c
@@ -56,6 +56,17 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info,
const struct pipe_draw_start_count *draws,
unsigned num_draws)
{
+ if (num_draws > 1) {
+ struct pipe_draw_info tmp_info = *info;
+
+ for (unsigned i = 0; i < num_draws; i++) {
+ llvmpipe_draw_vbo(pipe, &tmp_info, indirect, &draws[i], 1);
+ if (tmp_info.increment_draw_id)
+ tmp_info.drawid++;
+ }
+ return;
+ }
+
struct llvmpipe_context *lp = llvmpipe_context(pipe);
struct draw_context *draw = lp->draw;
const void *mapped_indices = NULL;