From 990b14f181d133641173498e65c9ddccc9ab16ad Mon Sep 17 00:00:00 2001
From: ReinUsesLisp <reinuseslisp@airmail.cc>
Date: Tue, 30 Jun 2020 05:01:38 -0300
Subject: [PATCH] video_core: Fix B5G6R5U

---
 src/video_core/renderer_opengl/gl_texture_cache.cpp | 2 +-
 src/video_core/renderer_vulkan/maxwell_to_vk.cpp    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index b5ebe0c43..ccfa7c9fe 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -45,7 +45,7 @@ constexpr std::array<FormatTuple, VideoCore::Surface::MaxPixelFormat> tex_format
     {GL_RGBA8_SNORM, GL_RGBA, GL_BYTE},                               // ABGR8S
     {GL_RGBA8I, GL_RGBA_INTEGER, GL_BYTE},                            // ABGR8I
     {GL_RGBA8UI, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE},                  // ABGR8UI
-    {GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV},                 // B5G6R5U
+    {GL_RGB565, GL_RGB, GL_UNSIGNED_SHORT_5_6_5},                     // B5G6R5U
     {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV},           // A2B10G10R10U
     {GL_RGB10_A2UI, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV}, // A2B10G10R10UI
     {GL_RGB5_A1, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV},             // A1B5G5R5U
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 134ef1781..fc53321e5 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -121,7 +121,7 @@ struct FormatTuple {
     {VK_FORMAT_A8B8G8R8_SNORM_PACK32, Attachable | Storage},    // ABGR8S
     {VK_FORMAT_A8B8G8R8_SINT_PACK32, Attachable | Storage},     // ABGR8I
     {VK_FORMAT_A8B8G8R8_UINT_PACK32, Attachable | Storage},     // ABGR8UI
-    {VK_FORMAT_B5G6R5_UNORM_PACK16},                            // B5G6R5U
+    {VK_FORMAT_R5G6B5_UNORM_PACK16, Attachable},                // B5G6R5U
     {VK_FORMAT_A2B10G10R10_UNORM_PACK32, Attachable | Storage}, // A2B10G10R10U
     {VK_FORMAT_A2B10G10R10_UINT_PACK32, Attachable | Storage},  // A2B10G10R10UI
     {VK_FORMAT_A1R5G5B5_UNORM_PACK16, Attachable},              // A1B5G5R5U (flipped with swizzle)