From d670dc0c0bddf7df1374f78c43dd684b03043b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Wed, 13 Nov 2024 12:44:36 +0100 Subject: [PATCH] radv: Only set NGG_DISABLE_PROVOK_REUSE for VS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn't do anything useful for other stages. In VS, we use this when the implicit primitive ID is needed, so that we can export that as a per-vertex attribute of the provoking vertex. In TES, the patch ID (which is used as the primitive ID) is already a per-vertex input VGPR, so it doesn't make sense to configure this. In GS, the primitive ID is explicitly written by the shader, so it makes no sense to disable provoking vertex reuse in the input. Signed-off-by: Timur Kristóf Reviewed-by: Georg Lehmann Part-of: --- src/amd/vulkan/radv_shader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index cc63fa0151e..082dd2181d9 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -1621,7 +1621,8 @@ radv_precompute_registers_hw_ngg(struct radv_device *device, const struct ac_sha S_02881C_VS_OUT_CCDIST0_VEC_ENA((total_mask & 0x0f) != 0) | S_02881C_VS_OUT_CCDIST1_VEC_ENA((total_mask & 0xf0) != 0) | total_mask << 8 | clip_dist_mask; - info->regs.ngg.vgt_primitiveid_en = S_028A84_NGG_DISABLE_PROVOK_REUSE(info->outinfo.export_prim_id); + info->regs.ngg.vgt_primitiveid_en = + S_028A84_NGG_DISABLE_PROVOK_REUSE(info->stage == MESA_SHADER_VERTEX && info->outinfo.export_prim_id); const uint32_t gs_num_invocations = info->stage == MESA_SHADER_GEOMETRY ? info->gs.invocations : 1;