diff options
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 57daf2a52aa..3f8625630bc 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3158,10 +3158,17 @@ static void visit_intrinsic(struct ac_nir_context *ctx, result = ctx->abi->view_index; break; case nir_intrinsic_load_invocation_id: - if (ctx->stage == MESA_SHADER_TESS_CTRL) + if (ctx->stage == MESA_SHADER_TESS_CTRL) { result = ac_unpack_param(&ctx->ac, ctx->abi->tcs_rel_ids, 8, 5); - else - result = ctx->abi->gs_invocation_id; + } else { + if (ctx->ac.chip_class >= GFX10) { + result = LLVMBuildAnd(ctx->ac.builder, + ctx->abi->gs_invocation_id, + LLVMConstInt(ctx->ac.i32, 127, 0), ""); + } else { + result = ctx->abi->gs_invocation_id; + } + } break; case nir_intrinsic_load_primitive_id: if (ctx->stage == MESA_SHADER_GEOMETRY) { |