Module: Mesa
Branch: main
Commit: b439bd5a5844e3df812f1f0362fd1a715058fb3a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b439bd5a5844e3df812f1f0362fd1a715058fb3a

Author: Samuel Pitoiset <[email protected]>
Date:   Tue May 23 18:50:52 2023 +0200

radv: do not enable VRS flat shading if the VRS builtin is read

When the fragment shader reads the VRS builtin, VRS flat shading
shouldn't be enabled, otherwise the value might not be what the FS
expects.

Fixes dEQP-VK.fragment_shading_rate.renderpass2.monolithic.multipass.*
on RDNA2 (VRS flat shading isn't yet enabled on RDNA3).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23187>

---

 src/amd/vulkan/radv_shader_info.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_shader_info.c 
b/src/amd/vulkan/radv_shader_info.c
index 508b92fb7eb..2deb4496b0e 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -587,7 +587,8 @@ gather_shader_info_fs(const struct radv_device *device, 
const nir_shader *nir,
 
    info->ps.allow_flat_shading =
       !(uses_persp_or_linear_interp || info->ps.needs_sample_positions ||
-        info->ps.writes_memory || nir->info.fs.needs_quad_helper_invocations ||
+        info->ps.reads_frag_shading_rate || info->ps.writes_memory ||
+        nir->info.fs.needs_quad_helper_invocations ||
         BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FRAG_COORD) ||
         BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_POINT_COORD) ||
         BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_SAMPLE_ID) ||

Reply via email to