diff options
author | voidanix <51296985+voidanix@users.noreply.github.com> | 2022-02-18 09:44:34 +0100 |
---|---|---|
committer | voidanix <51296985+voidanix@users.noreply.github.com> | 2022-02-21 09:21:41 +0100 |
commit | 7712e46d64e0eb857527cc2592a5373cc7b45e20 (patch) | |
tree | a89bc8c3494a3723ab5523de75669cf74095a998 /src/video_core/renderer_vulkan/vk_texture_cache.cpp | |
parent | Merge pull request #7867 from german77/amiibo (diff) | |
download | yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.tar yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.tar.gz yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.tar.bz2 yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.tar.lz yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.tar.xz yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.tar.zst yuzu-7712e46d64e0eb857527cc2592a5373cc7b45e20.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_texture_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.cpp | 6 |
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) { |