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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23187>
(cherry picked from commit b439bd5a58)
This commit is contained in:
Samuel Pitoiset 2023-05-23 18:50:52 +02:00 committed by Eric Engestrom
parent caa1ba767c
commit d3ae7a755f
2 changed files with 3 additions and 2 deletions

View file

@ -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
},

View file

@ -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) ||