turnip: fix RENDER_COMPONENTS value
authorJonathan Marek <jonathan@marek.ca>
Tue, 2 Jun 2020 02:02:19 +0000 (22:02 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 2 Jun 2020 18:42:09 +0000 (18:42 +0000)
commita2903dd767f77edccb671f30e9e0686b50879cca
tree2490212c91658f52ac4cfb1263658707901944d0
parentd63bd09eb2f6109fbef84ba75ee59ab075686612
turnip: fix RENDER_COMPONENTS value

This fixes render_components being 0 when mrt_count=8, because shift by 32
is UB and in arm64 it ends up shifting by 0. This fixes tests with 8 MRTs.

Fixes the 3d path sysmem CmdClearAttachments to set RENDER_COMPONENTS, as
it was previously relying on tu6_emit_mrt setting it, but it is now part of
the pipeline state.

Also switch back to the previous behavior of not setting render components
for VK_ATTACHMENT_UNUSED attachments: we don't update the MRT state for
such attachments so we definitely don't want to be trying writing to those.

Fixes: 078aa9df8daff60e52a66d8f ("tu: Move RENDER_COMPONENTS setting to pipeline state")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5292>
src/freedreno/vulkan/tu_clear_blit.c
src/freedreno/vulkan/tu_pipeline.c