summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-02-21 22:34:27 +0100
committerGitHub <noreply@github.com>2022-02-21 22:34:27 +0100
commitefe50d88ec48b4782f6b9185b068cd497e8de322 (patch)
tree88dd81fb42e7ae3121cb75a15762bf4f16f277a8 /src/video_core/renderer_vulkan
parentMerge pull request #7919 from bunnei/phys-mem-updates (diff)
parentvulkan_device: fix missing format in ANV (diff)
downloadyuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.tar
yuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.tar.gz
yuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.tar.bz2
yuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.tar.lz
yuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.tar.xz
yuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.tar.zst
yuzu-efe50d88ec48b4782f6b9185b068cd497e8de322.zip
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 0ba56ff1e..0f62779de 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -554,10 +554,12 @@ void CopyBufferToImage(vk::CommandBuffer cmdbuf, VkBuffer src_buffer, VkImage im
};
}
-[[nodiscard]] bool IsFormatFlipped(PixelFormat format) {
+[[nodiscard]] bool IsFormatFlipped(PixelFormat format, bool emulate_bgr565) {
switch (format) {
case PixelFormat::A1B5G5R5_UNORM:
return true;
+ case PixelFormat::B5G6R5_UNORM:
+ return emulate_bgr565;
default:
return false;
}
@@ -1488,7 +1490,7 @@ ImageView::ImageView(TextureCacheRuntime& runtime, const VideoCommon::ImageViewI
};
if (!info.IsRenderTarget()) {
swizzle = info.Swizzle();
- if (IsFormatFlipped(format)) {
+ if (IsFormatFlipped(format, device->MustEmulateBGR565())) {
std::ranges::transform(swizzle, swizzle.begin(), SwapBlueRed);
}
if ((aspect_mask & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0) {