From 5b8ceb917308378c535fb4cd2288b8f19524bea0 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 26 Aug 2021 17:47:21 -0300 Subject: [PATCH] Swap BGR565 components by changing the format (#2577) --- Ryujinx.Graphics.OpenGL/Image/TextureView.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Ryujinx.Graphics.OpenGL/Image/TextureView.cs b/Ryujinx.Graphics.OpenGL/Image/TextureView.cs index d4d49075..a70ab595 100644 --- a/Ryujinx.Graphics.OpenGL/Image/TextureView.cs +++ b/Ryujinx.Graphics.OpenGL/Image/TextureView.cs @@ -204,7 +204,18 @@ namespace Ryujinx.Graphics.OpenGL.Image if (forceBgra) { - pixelFormat = PixelFormat.Bgra; + if (pixelType == PixelType.UnsignedShort565) + { + pixelType = PixelType.UnsignedShort565Reversed; + } + else if (pixelType == PixelType.UnsignedShort565Reversed) + { + pixelType = PixelType.UnsignedShort565; + } + else + { + pixelFormat = PixelFormat.Bgra; + } } int faces = 1;