diff --git a/src/amd/vulkan/radv_sdma.c b/src/amd/vulkan/radv_sdma.c index e32a16de2b9..dbab3356661 100644 --- a/src/amd/vulkan/radv_sdma.c +++ b/src/amd/vulkan/radv_sdma.c @@ -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; } diff --git a/src/amd/vulkan/radv_sdma.h b/src/amd/vulkan/radv_sdma.h index 62818ee2ad2..098365a8bb4 100644 --- a/src/amd/vulkan/radv_sdma.h +++ b/src/amd/vulkan/radv_sdma.h @@ -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. */