diff options
author | Samuel Pitoiset <[email protected]> | 2019-10-31 14:00:52 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-11-25 07:25:48 +0000 |
commit | bfb307aea922218cb72ffc9d977e88dfcadb2daf (patch) | |
tree | 5671cf42a67edb0ea81e7f89b4363840e33cfc8d /src/amd | |
parent | b99295fb332bcde5c4168acb5d9d9aede10519e3 (diff) |
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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/llvm/ac_nir_to_llvm.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, ""); } |