From 534cc99081049c108c4e34ca7cc5cebe41b0faf5 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 13 May 2022 15:18:41 +0200 Subject: [PATCH] aco: do not emit the primitive ID twice for NGG VS or TES with GS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The primitive ID is required to be exported by the GS stage, so this should only be needed for NGG VS or TES without a GS stage. Otherwise, it's exported twice. No fossils-db changes. Signed-off-by: Samuel Pitoiset Reviewed-by: Timur Kristóf Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index b34e71c836d..95e62eb16b1 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -5015,12 +5015,15 @@ visit_store_output(isel_context* ctx, nir_intrinsic_instr* instr) unreachable("Shader stage not implemented"); } - /* For NGG VS and TES shaders the primitive ID is exported manually after the other exports so we - * have to emit an exp here manually */ + /* For NGG VS and TES shaders (without GS) the primitive ID is exported + * manually after the other exports so we have to emit an exp here manually + */ if (ctx->stage.hw == HWStage::NGG && (ctx->stage.has(SWStage::VS) || ctx->stage.has(SWStage::TES)) && - nir_intrinsic_io_semantics(instr).location == VARYING_SLOT_PRIMITIVE_ID) + !ctx->stage.has(SWStage::GS) && + nir_intrinsic_io_semantics(instr).location == VARYING_SLOT_PRIMITIVE_ID) { export_vs_varying(ctx, VARYING_SLOT_PRIMITIVE_ID, false, NULL); + } } void