mirror of
https://github.com/Takiiiiiiii/strato.git
synced 2025-07-17 08:46:39 +00:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user