From 3c5c96fedb77220eac590327699bffcb611a9896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 13 Dec 2025 01:20:10 -0500 Subject: [PATCH] radv: double pixel throughput in certain cases of PS without interpolated inputs This reduces the number of initialized VGPRs by 1 when no barycentric coordinates are used. I have verified with zink that this indeed increases performance for cases where sysvals like frag_coord and front_face are used without interpolated PS inputs. Reviewed-by: Georg Lehmann Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_shader.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 1c6c0ca6ef8..7cf5ade8ed1 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -3735,9 +3735,12 @@ radv_compute_spi_ps_input(const struct radv_physical_device *pdev, const struct spi_ps_input |= S_0286CC_PERSP_CENTER_ENA(1); } - if (!(spi_ps_input & 0x7F)) { - /* At least one of PERSP_* (0xF) or LINEAR_* (0x70) must be enabled */ - spi_ps_input |= S_0286CC_PERSP_CENTER_ENA(1); + if (!(spi_ps_input & 0x7F) && !G_0286CC_LINE_STIPPLE_TEX_ENA(spi_ps_input)) { + /* At least one of PERSP_* (0xF) or LINEAR_* (0x70) or LINE_STIPPLE_TEX must be enabled. + * LINE_STIPPLE_TEX uses the least number of initialized VGPRs, so let's use it because + * pixel throughput is limited by the number of initialized VGPRs. + */ + spi_ps_input |= S_0286CC_LINE_STIPPLE_TEX_ENA(1); } return spi_ps_input;