summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Seurer <konstantin.seurer@gmail.com>2023-07-23 12:33:15 +0200
committerEric Engestrom <eric@engestrom.ch>2023-07-28 18:48:24 +0100
commit90d121b65bf0b49045a0a391ecac3d31a4009833 (patch)
treed404407419f6354bdc7494e88ba37c72c9d741fb /src
parentbd9177f20ea19af3163d82cc1a1be3639f7ddb76 (diff)
downloadmesa-90d121b65bf0b49045a0a391ecac3d31a4009833.tar.gz
mesa-90d121b65bf0b49045a0a391ecac3d31a4009833.tar.bz2
mesa-90d121b65bf0b49045a0a391ecac3d31a4009833.zip
draw: Do not restart the primitive_id at 0
Otherwise the primitive_id will wrap around to 0 if more than 4096 patches are drawn. cc: mesa-stable Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24295> (cherry picked from commit 1280cf5b2afa757b86c21085d01229222e4180df)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_tess.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
index dff17a41ac0..edaa78af36e 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline_llvm.c
@@ -829,7 +829,7 @@ llvm_middle_end_linear_run(struct draw_pt_middle_end *middle,
fetch_info.elts = NULL;
prim_info.linear = TRUE;
- prim_info.start = 0;
+ prim_info.start = start;
prim_info.count = count;
prim_info.elts = NULL;
prim_info.prim = prim_type(fpme->input_prim, prim_flags);
diff --git a/src/gallium/auxiliary/draw/draw_tess.c b/src/gallium/auxiliary/draw/draw_tess.c
index c0430b02a40..4240b48e515 100644
--- a/src/gallium/auxiliary/draw/draw_tess.c
+++ b/src/gallium/auxiliary/draw/draw_tess.c
@@ -189,6 +189,7 @@ int draw_tess_ctrl_shader_run(struct draw_tess_ctrl_shader *shader,
shader->draw->statistics.hs_invocations += num_patches;
}
#ifdef DRAW_LLVM_AVAILABLE
+ unsigned first_patch = input_prim->start / shader->draw->pt.vertices_per_patch;
for (unsigned i = 0; i < num_patches; i++) {
uint32_t vert_start = output_verts->count;
@@ -196,7 +197,7 @@ int draw_tess_ctrl_shader_run(struct draw_tess_ctrl_shader *shader,
llvm_fetch_tcs_input(shader, input_prim, i, shader->draw->pt.vertices_per_patch);
- llvm_tcs_run(shader, i);
+ llvm_tcs_run(shader, first_patch + i);
uint32_t old_verts = util_align_npot(vert_start, 16);
uint32_t new_verts = util_align_npot(output_verts->count, 16);