aco: do not emit the primitive ID twice for NGG VS or TES with GS

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 <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16498>
This commit is contained in:
Samuel Pitoiset
2022-05-13 15:18:41 +02:00
committed by Marge Bot
parent 3999fcba15
commit 534cc99081
@@ -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