Mesa (staging/22.0): aux/draw: fix llvm tcs lane vec generation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 10 21:09:38 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: d8afb09eecd2e8e6f29a5b7a75888b8fa8508432
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8afb09eecd2e8e6f29a5b7a75888b8fa8508432

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Feb  9 09:07:41 2022 -0500

aux/draw: fix llvm tcs lane vec generation

the idx param for LLVMBuildInsertElement is zero-indexed based on the
value of 'vector_length' (always 4), and the vector length is (obviously)
sized to 'vector_length', so this should be the member of the vec that is being
inserted, not the invocation index

cc: mesa-stable

fixes (zink, but only on my one machine):
KHR-GL46.tessellation_shader.single.max_patch_vertices
KHR-GL46.tessellation_shader.tessellation_shader_tc_barriers.barrier_guarded_read_write_calls
dEQP-GLES31.functional.tessellation.shader_input_output.barrier
dEQP-GLES31.functional.tessellation.shader_input_output.patch_vertices_5_in_10_out
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_isolines_geometry_output_points
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_isolines_point_mode_geometry_output_triangles
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_quads_geometry_output_points
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_quads_point_mode_geometry_output_lines
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_triangles_geometry_output_points
dEQP-GLES31.functional.tessellation_geometry_interaction.feedback.tessellation_output_triangles_point_mode_geometry_output_lines

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14949>
(cherry picked from commit 68c1b50e48e32ec8ff4815666b7124d4cb4171ab)

---

 .pick_status.json                      | 2 +-
 src/gallium/auxiliary/draw/draw_llvm.c | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index aaa0585f534..ae8d6fc60db 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -355,7 +355,7 @@
         "description": "aux/draw: fix llvm tcs lane vec generation",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index e21d36cefdc..483bf62b44c 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -3515,8 +3515,9 @@ draw_tcs_llvm_generate(struct draw_llvm *llvm,
    LLVMValueRef counter = LLVMGetParam(variant_coro, 6);
    LLVMValueRef invocvec = LLVMGetUndef(LLVMVectorType(int32_type, vector_length));
    for (i = 0; i < vector_length; i++) {
-      LLVMValueRef idx = LLVMBuildAdd(builder, LLVMBuildMul(builder, counter, step, ""), lp_build_const_int32(gallivm, i), "");
-      invocvec = LLVMBuildInsertElement(builder, invocvec, idx, idx, "");
+      LLVMValueRef loop_iter = lp_build_const_int32(gallivm, i);
+      LLVMValueRef idx = LLVMBuildAdd(builder, LLVMBuildMul(builder, counter, step, ""), loop_iter, "");
+      invocvec = LLVMBuildInsertElement(builder, invocvec, idx, loop_iter, "");
    }
 
    system_values.invocation_id = invocvec;



More information about the mesa-commit mailing list