From d3ae7a755f154a8836fe4d3a2760478632173f94 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 23 May 2023 18:50:52 +0200 Subject: [PATCH] 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 Part-of: (cherry picked from commit b439bd5a5844e3df812f1f0362fd1a715058fb3a) --- .pick_status.json | 2 +- src/amd/vulkan/radv_shader_info.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 885ed7cb5a4..813d40228aa 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -967,7 +967,7 @@ "description": "radv: do not enable VRS flat shading if the VRS builtin is read", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index be5fa2f7fa4..ff80c395136 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -597,7 +597,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) ||