From c425b7342eafd25f04407820fc2615bf5ff8601a Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Wed, 31 Aug 2022 12:23:43 -0700 Subject: [PATCH] turnip: Add perf_debug for UBWC being disabled due to mutable formats. I suspect this is going to be a popular perf issue for zink and angle. I keep having to print out format lists for debug. Part-of: --- src/freedreno/vulkan/tu_image.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_image.c b/src/freedreno/vulkan/tu_image.c index be3e84273fb..d66264ddd50 100644 --- a/src/freedreno/vulkan/tu_image.c +++ b/src/freedreno/vulkan/tu_image.c @@ -444,7 +444,27 @@ tu_image_init(struct tu_device *device, struct tu_image *image, const VkImageFormatListCreateInfo *fmt_list = vk_find_struct_const(pCreateInfo->pNext, IMAGE_FORMAT_LIST_CREATE_INFO); if (!tu6_mutable_format_list_ubwc_compatible(fmt_list)) { - ubwc_enabled = false; + if (ubwc_enabled) { + if (fmt_list && fmt_list->viewFormatCount == 2) { + perf_debug( + device, + "Disabling UBWC on %dx%d %s resource due to mutable formats " + "(fmt list %s, %s)", + image->vk.extent.width, image->vk.extent.height, + util_format_name(vk_format_to_pipe_format(image->vk.format)), + util_format_name(vk_format_to_pipe_format(fmt_list->pViewFormats[0])), + util_format_name(vk_format_to_pipe_format(fmt_list->pViewFormats[1]))); + } else { + perf_debug( + device, + "Disabling UBWC on %dx%d %s resource due to mutable formats " + "(fmt list %s)", + image->vk.extent.width, image->vk.extent.height, + util_format_name(vk_format_to_pipe_format(image->vk.format)), + fmt_list ? "present" : "missing"); + } + ubwc_enabled = false; + } if (format_list_reinterprets_r8g8_r16(format, fmt_list) || format_list_has_swaps(fmt_list)) {