From 6cf2fb1fc48974d72a37bbe3cc77a69244a2855a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 21 Jun 2019 21:06:16 -0400 Subject: [PATCH] radeonsi/gfx10: unpack GS invocation ID Acked-by: Bas Nieuwenhuizen --- src/gallium/drivers/radeonsi/si_shader.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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: -- 2.30.2