summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nvc0
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/nouveau/nvc0
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/nouveau/nvc0')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
index 3270207c703..5cf02387da3 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_vbo.c
@@ -927,6 +927,17 @@ nvc0_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++) {
+ nvc0_draw_vbo(pipe, &tmp_info, indirect, &draws[i], 1);
+ if (tmp_info.increment_draw_id)
+ tmp_info.drawid++;
+ }
+ return;
+ }
+
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
struct nvc0_screen *screen = nvc0->screen;