diff options
author | Samuel Pitoiset <[email protected]> | 2019-06-25 11:45:26 +0200 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2019-07-07 17:03:38 +0200 |
commit | c3459968cd889143929c875a225757d106642769 (patch) | |
tree | 83007b079c7be0339063df3b367ef90dc26710b5 /src/amd/common | |
parent | 4d7c420a94f924c6ee62dd5b045337dbde465398 (diff) |
ac/nir: unpacked GS invocation ID on GFX10+
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/common')
-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) { |