From 29488c4183095e0bf5ae90cc2899127cdf3f5f10 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 6 Oct 2022 10:42:22 -0700 Subject: [PATCH] turnip: Move the ubwc_possible check before mutable formats. I'm going to add some perf debug about mutable formats, and I don't want to warn when UBWC would be impossible anyway. Part-of: --- src/freedreno/vulkan/tu_image.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index 54211acca8d..be3e84273fb 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -421,6 +421,12 @@ tu_image_init(struct tu_device *device, struct tu_image *image, /* Whether a view of the image with an R8G8 format could be made. */ bool has_r8g8 = tu_is_r8g8(format); + if (!ubwc_possible(image->vk.format, pCreateInfo->imageType, + pCreateInfo->usage, image->vk.stencil_usage, + device->physical_device->info, pCreateInfo->samples, + device->use_z24uint_s8uint)) + ubwc_enabled = false; + /* Mutable images can be reinterpreted as any other compatible format. * This is a problem with UBWC (compression for different formats is different), * but also tiling ("swap" affects how tiled formats are stored in memory) @@ -447,12 +453,6 @@ tu_image_init(struct tu_device *device, struct tu_image *image, } } - if (!ubwc_possible(image->vk.format, pCreateInfo->imageType, - pCreateInfo->usage, image->vk.stencil_usage, - device->physical_device->info, pCreateInfo->samples, - device->use_z24uint_s8uint)) - ubwc_enabled = false; - /* expect UBWC enabled if we asked for it */ if (modifier == DRM_FORMAT_MOD_QCOM_COMPRESSED) assert(ubwc_enabled);