radv: add a workaround for color<->stencil only copies on SDMA4-5
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

For weird reasons, on SDMA4-5 color<->stencil only copies don't work
correctly. I compared NAVI21 (SDMA 5) vs NAVI31 (SDMA 6), everything
is bits-to-bits exact but the same test doesn't pass on NAVI21. So,
it's potentially a hardware bug on SDMA < 6.

Fixes dEQP-VK.api.ds_color_copy.*_tq on GFX9-GFX10.3.

Fixes: 0034f5a948 ("radv: allow ds<->color copies on compute/transfer queues")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38377>
This commit is contained in:
Samuel Pitoiset 2025-11-11 16:16:26 +01:00 committed by Marge Bot
parent 54715e8989
commit e47a60255a
2 changed files with 10 additions and 0 deletions

View file

@ -292,6 +292,7 @@ radv_sdma_get_surf(const struct radv_device *const device, const struct radv_ima
const uint64_t va = binding->addr;
const uint32_t bpe = radv_sdma_get_bpe(image, subresource.aspectMask);
struct radv_sdma_surf info = {
.format = image->vk.format,
.extent =
{
.width = vk_format_get_plane_width(image->vk.format, plane_idx, image->vk.extent.width),
@ -813,6 +814,14 @@ radv_sdma_use_t2t_scanline_copy(const struct radv_device *device, const struct r
!util_is_aligned(dst_offset_blk.z, alignment->depth))
return true;
if (ver < SDMA_6_0 && ((src->format == VK_FORMAT_S8_UINT && vk_format_is_color(dst->format)) ||
(vk_format_is_color(src->format) && dst->format == VK_FORMAT_S8_UINT))) {
/* For weird reasons, color<->stencil only T2T subwindow copies on SDMA4-5 don't work as
* expected, and the driver needs to fallback to scanline copies to workaround them.
*/
return true;
}
return false;
}

View file

@ -16,6 +16,7 @@ extern "C" {
#endif
struct radv_sdma_surf {
VkFormat format; /* Image format. */
VkExtent3D extent; /* Image extent. */
VkOffset3D offset; /* Image offset. */
uint64_t va; /* Virtual address of image data. */