Mesa (master): ac/llvm: fix the local invocation index for wave32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 25 07:42:48 UTC 2019


Module: Mesa
Branch: master
Commit: bfb307aea922218cb72ffc9d977e88dfcadb2daf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bfb307aea922218cb72ffc9d977e88dfcadb2daf

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Thu Oct 31 14:00:52 2019 +0100

ac/llvm: fix the local invocation index for wave32

Fixes dEQP-VK.compute.builtin_var.local_invocation_index with
RADV_PERFTEST=cswave32.

My initial fix was to lower it but Rhys suggested the shift-right
and it's much better like this.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/llvm/ac_nir_to_llvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c
index 02a640603f3..8fae7bb5b77 100644
--- a/src/amd/llvm/ac_nir_to_llvm.c
+++ b/src/amd/llvm/ac_nir_to_llvm.c
@@ -2905,6 +2905,10 @@ visit_load_local_invocation_index(struct ac_nir_context *ctx)
 	result = LLVMBuildAnd(ctx->ac.builder, ctx->abi->tg_size,
 			      LLVMConstInt(ctx->ac.i32, 0xfc0, false), "");
 
+	if (ctx->ac.wave_size == 32)
+		result = LLVMBuildLShr(ctx->ac.builder, result,
+				       LLVMConstInt(ctx->ac.i32, 1, false), "");
+
 	return LLVMBuildAdd(ctx->ac.builder, result, thread_id, "");
 }
 




More information about the mesa-commit mailing list