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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18990>
This commit is contained in:
Emma Anholt
2022-10-06 10:42:22 -07:00
committed by Marge Bot
parent 4fe3330765
commit 29488c4183
+6 -6
View File
@@ -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);