From: Samuel Pitoiset Date: Tue, 25 Jun 2019 09:45:26 +0000 (+0200) Subject: ac/nir: unpacked GS invocation ID on GFX10+ X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c3459968cd889143929c875a225757d106642769;p=mesa.git ac/nir: unpacked GS invocation ID on GFX10+ Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- 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) {