radv: fix emitting VRS state with a null fragment shader
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 16 May 2023 09:58:42 +0000 (11:58 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 17 May 2023 06:12:19 +0000 (06:12 +0000)
Found this while debugging a VRS issue with Valhalla.

Fixes: 87245c6e8e6 ("radv: handle NULL fragment shaders when recording cmdbuf")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23050>

src/amd/vulkan/radv_cmd_buffer.c

index 03583d1..0eaad28 100644 (file)
@@ -2354,7 +2354,7 @@ radv_emit_fragment_shading_rate(struct radv_cmd_buffer *cmd_buffer)
     * 2) the fragment shader reads gl_SampleMaskIn because the 16-bit sample coverage mask isn't
     *    enough for MSAA8x and 2x2 coarse shading isn't enough.
     */
-   if (cmd_buffer->state.ms.sample_shading_enable || ps->info.ps.reads_sample_mask_in) {
+   if (cmd_buffer->state.ms.sample_shading_enable || (ps && ps->info.ps.reads_sample_mask_in)) {
       pa_cl_vrs_cntl |= S_028848_SAMPLE_ITER_COMBINER_MODE(V_028848_SC_VRS_COMB_MODE_OVERRIDE);
    }