From 0b672a08acd6845f9f5c36c67511454be04b7fd4 Mon Sep 17 00:00:00 2001 From: "Daniel R." <47796739+polybiusproxy@users.noreply.github.com> Date: Sun, 8 Dec 2024 15:57:51 +0100 Subject: [PATCH] video_core: improve image cube heuristic --- src/video_core/texture_cache/image.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/video_core/texture_cache/image.cpp b/src/video_core/texture_cache/image.cpp index 3d5202ad..ea298c04 100644 --- a/src/video_core/texture_cache/image.cpp +++ b/src/video_core/texture_cache/image.cpp @@ -151,9 +151,10 @@ Image::Image(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_, // the texture cache should re-create the resource with the usage requested vk::ImageCreateFlags flags{vk::ImageCreateFlagBits::eMutableFormat | vk::ImageCreateFlagBits::eExtendedUsage}; - const bool can_be_cube = (info.type == vk::ImageType::e2D) && - (info.resources.layers % 6 == 0) && - (info.size.width == info.size.height); + const bool can_be_cube = + (info.type == vk::ImageType::e2D) && + (info.props.is_pow2 ? (info.resources.layers % 8) : (info.resources.layers % 6) == 0) && + (info.size.width == info.size.height); if (info.props.is_cube || can_be_cube) { flags |= vk::ImageCreateFlagBits::eCubeCompatible; } else if (info.props.is_volume) {