From: Marek Olšák Date: Sat, 22 Jun 2019 01:06:16 +0000 (-0400) Subject: radeonsi/gfx10: unpack GS invocation ID X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6cf2fb1fc48974d72a37bbe3cc77a69244a2855a;p=mesa.git radeonsi/gfx10: unpack GS invocation ID Acked-by: Bas Nieuwenhuizen --- diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 27a5aa3b5ee..1dec250e6d3 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2044,12 +2044,19 @@ void si_load_system_value(struct si_shader_context *ctx, break; case TGSI_SEMANTIC_INVOCATIONID: - if (ctx->type == PIPE_SHADER_TESS_CTRL) + if (ctx->type == PIPE_SHADER_TESS_CTRL) { value = unpack_llvm_param(ctx, ctx->abi.tcs_rel_ids, 8, 5); - else if (ctx->type == PIPE_SHADER_GEOMETRY) - value = ctx->abi.gs_invocation_id; - else + } else if (ctx->type == PIPE_SHADER_GEOMETRY) { + if (ctx->screen->info.chip_class >= GFX10) { + value = LLVMBuildAnd(ctx->ac.builder, + ctx->abi.gs_invocation_id, + LLVMConstInt(ctx->i32, 127, 0), ""); + } else { + value = ctx->abi.gs_invocation_id; + } + } else { assert(!"INVOCATIONID not implemented"); + } break; case TGSI_SEMANTIC_POSITION: