From 13baf2312f88d1f97e1114a22c127d1b82ee6f26 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 6 Nov 2022 20:41:36 +0000 Subject: [PATCH] Add a workaround for sampling BGRA textures with a swizzle --- app/src/main/cpp/skyline/gpu/texture/texture.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/cpp/skyline/gpu/texture/texture.cpp b/app/src/main/cpp/skyline/gpu/texture/texture.cpp index 15591f89..4dba914b 100644 --- a/app/src/main/cpp/skyline/gpu/texture/texture.cpp +++ b/app/src/main/cpp/skyline/gpu/texture/texture.cpp @@ -862,6 +862,13 @@ namespace skyline::gpu { range.aspectMask = format->Aspect(mapping.r == vk::ComponentSwizzle::eR); } + // Workaround to avoid aliasing when sampling from a BGRA texture with a RGBA view and a mapping to counteract that + // TODO: drop this after new texture manager + if (pFormat == format::R8G8B8A8Unorm && format == format::B8G8R8A8Unorm && mapping == vk::ComponentMapping{vk::ComponentSwizzle::eB, vk::ComponentSwizzle::eG, vk::ComponentSwizzle::eR, vk::ComponentSwizzle::eA}) { + pFormat = format; + mapping = vk::ComponentMapping{}; + } + return std::make_shared(shared_from_this(), type, range, pFormat, mapping); }