Procházet zdrojové kódy

Swap BGR565 components by changing the format (#2577)

gdkchan před 4 roky
rodič
revize
5b8ceb9173
1 změnil soubory, kde provedl 12 přidání a 1 odebrání
  1. 12 1
      Ryujinx.Graphics.OpenGL/Image/TextureView.cs

+ 12 - 1
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;