Sfoglia il codice sorgente

Swap BGR565 components by changing the format (#2577)

gdkchan 4 anni fa
parent
commit
5b8ceb9173
1 ha cambiato i file con 12 aggiunte e 1 eliminazioni
  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;