From 1aa3bb4e228820b39047c649356d41e47d16159f Mon Sep 17 00:00:00 2001 From: Lars-Ivar Hesselberg Simonsen Date: Tue, 3 Dec 2024 17:08:10 +0100 Subject: [PATCH] panvk: Disable AFBC for mutable formats on v7 As v7 only allows AFBC for RGB and BGR component swizzles, we'll need to disable AFBC in case an image is created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT as we can no longer ensure they adhere to this limitation. Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/panvk_image.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_image.c b/src/panfrost/vulkan/panvk_image.c index d1dbd02682d..f556277a730 100644 --- a/src/panfrost/vulkan/panvk_image.c +++ b/src/panfrost/vulkan/panvk_image.c @@ -73,6 +73,7 @@ panvk_image_can_use_mod(struct panvk_image *image, uint64_t mod) * - tiling is set to linear * - this is a 1D image * - this is a 3D image on a pre-v7 GPU + * - this is a mutable format image on v7 */ if (!(instance->debug_flags & PANVK_DEBUG_AFBC) || ((image->vk.usage | image->vk.stencil_usage) & @@ -82,7 +83,9 @@ panvk_image_can_use_mod(struct panvk_image *image, uint64_t mod) !panfrost_format_supports_afbc(arch, pfmt) || image->vk.tiling == VK_IMAGE_TILING_LINEAR || image->vk.image_type == VK_IMAGE_TYPE_1D || - (image->vk.image_type == VK_IMAGE_TYPE_3D && arch < 7)) + (image->vk.image_type == VK_IMAGE_TYPE_3D && arch < 7) || + ((image->vk.create_flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) && + arch == 7)) return false; const struct util_format_description *fdesc =