Adjust texture matching hacks

This commit is contained in:
Billy Laws 2022-10-30 16:24:43 +00:00
parent 4f5c9047ef
commit 2dd4698441
2 changed files with 5 additions and 1 deletions

View File

@ -857,6 +857,11 @@ namespace skyline::gpu {
if (gpu.traits.quirks.vkImageMutableFormatCostly && viewFormat != textureFormat && (!gpu.traits.quirks.adrenoRelaxedFormatAliasing || !texture::IsAdrenoAliasCompatible(viewFormat, textureFormat)))
Logger::Warn("Creating a view of a texture with a different format without mutable format: {} - {}", vk::to_string(viewFormat), vk::to_string(textureFormat));
if ((pFormat->vkAspect & format->vkAspect) == vk::ImageAspectFlagBits{}) {
pFormat = format; // If the requested format doesn't share any aspects then fallback to the texture's format in the hope it's more likely to function
range.aspectMask = format->Aspect(mapping.r == vk::ComponentSwizzle::eR);
}
return std::make_shared<TextureView>(shared_from_this(), type, range, pFormat, mapping);
}

View File

@ -115,7 +115,6 @@ namespace skyline::gpu {
constexpr bool IsCompatible(const FormatBase &other) const {
return vkFormat == other.vkFormat
|| (vkFormat == vk::Format::eD32Sfloat && other.vkFormat == vk::Format::eR32Sfloat)
|| (vkFormat == vk::Format::eR32Sfloat && other.vkFormat == vk::Format::eD32Sfloat)
|| (componentCount(vkFormat) == componentCount(other.vkFormat) &&
ranges::all_of(ranges::views::iota(u8{0}, componentCount(vkFormat)), [this, other](auto i) {
return componentBits(vkFormat, i) == componentBits(other.vkFormat, i);