Add quirk to avoid VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT on Adreno GPUs

Adreno GPUs have significant performance penalties from usage of `VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT` which require disabling UBWC and on Turnip, forces linear tiling. As a result, it's been made an optional quirk which doesn't supply the flag in `VkImageCreateInfo` and logs a warning if a view with a different Vulkan format from the original image is created.
This commit is contained in:
PixelyIon
2022-03-12 20:01:52 +05:30
parent 731d06010d
commit 24d7066d8b
3 changed files with 13 additions and 3 deletions

View File

@ -307,7 +307,7 @@ namespace skyline::gpu {
usage |= vk::ImageUsageFlagBits::eDepthStencilAttachment;
vk::ImageCreateInfo imageCreateInfo{
.flags = vk::ImageCreateFlagBits::eMutableFormat,
.flags = gpu.traits.quirks.vkImageMutableFormatCostly ? vk::ImageCreateFlags{} : vk::ImageCreateFlagBits::eMutableFormat,
.imageType = guest->dimensions.GetType(),
.format = *guest->format,
.extent = guest->dimensions,
@ -528,6 +528,9 @@ namespace skyline::gpu {
++viewIt;
}
if (gpu.traits.quirks.vkImageMutableFormatCostly && pFormat->vkFormat != format->vkFormat)
Logger::Warn("Creating a view of a texture with a different format without mutable format");
auto view{std::make_shared<TextureView>(shared_from_this(), type, range, pFormat, mapping)};
views.push_back(view);
return view;