radv: stop skip emitting CB states when there is no color attachment
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 26 Sep 2023 14:37:28 +0000 (16:37 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 28 Sep 2023 13:32:35 +0000 (13:32 +0000)
commitaf2a96bb37b099067adb490d189399b46324b46f
tree68071c31bed4336511be656fd292c928bbee30a9
parent441e57048b4e0b09effad202ba4a5c8f8b08131a
radv: stop skip emitting CB states when there is no color attachment

This is actually wrong. For example, if there is a DCC decompress
draw followed by a draw without any color attachments,
CB_COLOR_CONTROL.MODE is still CB_DCC_DECOMPRESS but it should be
CB_DISABLED. For some reasons, this hangs on RDNA3 (VM faults are also
reported through dmesg).

This fixes GPU hangs with Resident Evil 6, Star Wars The Old Republic
and probably more games on RDNA3.

Strictly speaking, I don't think this dynamic state optimization is
worth a try, even for other states, and I think it would be safer to
remove it completely.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9335
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8327
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9878
Fixes: c08082e8615 ("radv: ignore all CB dynamic states when there is no color attachments")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25402>
src/amd/vulkan/radv_pipeline_graphics.c