tu: Fix VK_FORMAT_A8_UNORM_KHR using UBWC when !has_8bpp_ubwc
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Thu, 5 Oct 2023 13:11:35 +0000 (15:11 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 5 Oct 2023 22:36:06 +0000 (22:36 +0000)
Fixes hangs in Anno 1800 with DXVK 2.3

Fixes: 302907e347612c3d748c88aed90fd6ab60a638f5
("tu: Expose VK_KHR_maintenance5")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25567>

src/freedreno/vulkan/tu_image.cc

index 73276a9..00134d1 100644 (file)
@@ -316,11 +316,8 @@ ubwc_possible(struct tu_device *device,
       return false;
 
    if (!info->a6xx.has_8bpp_ubwc &&
-       (format == VK_FORMAT_R8_UNORM ||
-        format == VK_FORMAT_R8_SNORM ||
-        format == VK_FORMAT_R8_UINT ||
-        format == VK_FORMAT_R8_SINT ||
-        format == VK_FORMAT_R8_SRGB))
+       vk_format_get_blocksizebits(format) == 8 &&
+       tu6_plane_count(format) == 1)
       return false;
 
    if (type == VK_IMAGE_TYPE_3D) {