radv: fix missing SQTT barriers for fbfetch color/depth decompressions

SQTT layout transitions need to be inside SQTT barrier. Otherwise, this
throws an assertion in RADV and might also crash when the capture is
opened with RGP.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12664
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33719>
(cherry picked from commit 67c150bf9e)
This commit is contained in:
Samuel Pitoiset 2025-02-24 18:20:25 +01:00 committed by Eric Engestrom
parent 539f0d88be
commit 20bb982788
2 changed files with 9 additions and 1 deletions

View file

@ -1654,7 +1654,7 @@
"description": "radv: fix missing SQTT barriers for fbfetch color/depth decompressions",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -8847,11 +8847,15 @@ radv_handle_color_fbfetch_output(struct radv_cmd_buffer *cmd_buffer, uint32_t in
radv_src_access_flush(cmd_buffer, VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT, VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT, 0,
att->iview->image, &range);
radv_describe_barrier_start(cmd_buffer, RGP_BARRIER_UNKNOWN_REASON);
/* Force a transition to FEEDBACK_LOOP_OPTIMAL to decompress DCC. */
radv_handle_image_transition(cmd_buffer, att->iview->image, att->layout,
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT, RADV_QUEUE_GENERAL,
RADV_QUEUE_GENERAL, &range, NULL);
radv_describe_barrier_end(cmd_buffer);
att->layout = VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT;
cmd_buffer->state.flush_bits |= radv_dst_access_flush(
@ -8891,11 +8895,15 @@ radv_handle_depth_fbfetch_output(struct radv_cmd_buffer *cmd_buffer)
radv_src_access_flush(cmd_buffer, VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, 0, att->iview->image, &range);
radv_describe_barrier_start(cmd_buffer, RGP_BARRIER_UNKNOWN_REASON);
/* Force a transition to FEEDBACK_LOOP_OPTIMAL to decompress HTILE. */
radv_handle_image_transition(cmd_buffer, att->iview->image, att->layout,
VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT, RADV_QUEUE_GENERAL,
RADV_QUEUE_GENERAL, &range, NULL);
radv_describe_barrier_end(cmd_buffer);
att->layout = VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT;
att->stencil_layout = VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT;