From 28967c9f5e47c9726ca7836a0e0224ed1f2e0ab8 Mon Sep 17 00:00:00 2001 From: HorrorTroll Date: Thu, 20 Sep 2018 12:09:27 +0700 Subject: [PATCH] Fix R8G8 Unorm to G8R8 Unorm --- Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs | 8 ++++---- Ryujinx.Graphics/Texture/ImageUtils.cs | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs index 187d1eece7..e9a63375e1 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs @@ -155,10 +155,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL case GalImageFormat.R16G16 | GalImageFormat.Sint: return (PixelInternalFormat.Rg16i, PixelFormat.RgInteger, PixelType.Short); case GalImageFormat.R16G16 | GalImageFormat.Snorm: return (PixelInternalFormat.Rg16Snorm, PixelFormat.Rg, PixelType.Byte); case GalImageFormat.R16G16 | GalImageFormat.Unorm: return (PixelInternalFormat.Rg16, PixelFormat.Rg, PixelType.UnsignedShort); - case GalImageFormat.R8G8 | GalImageFormat.Sint: return (PixelInternalFormat.Rg8i, PixelFormat.RgInteger, PixelType.Byte); - case GalImageFormat.R8G8 | GalImageFormat.Snorm: return (PixelInternalFormat.Rg8Snorm, PixelFormat.Rg, PixelType.Byte); - case GalImageFormat.R8G8 | GalImageFormat.Uint: return (PixelInternalFormat.Rg8ui, PixelFormat.RgInteger, PixelType.UnsignedByte); - case GalImageFormat.R8G8 | GalImageFormat.Unorm: return (PixelInternalFormat.Rg8, PixelFormat.Rg, PixelType.UnsignedByte); + case GalImageFormat.G8R8 | GalImageFormat.Sint: return (PixelInternalFormat.Rg8i, PixelFormat.RgInteger, PixelType.Byte); + case GalImageFormat.G8R8 | GalImageFormat.Snorm: return (PixelInternalFormat.Rg8Snorm, PixelFormat.Rg, PixelType.Byte); + case GalImageFormat.G8R8 | GalImageFormat.Uint: return (PixelInternalFormat.Rg8ui, PixelFormat.RgInteger, PixelType.UnsignedByte); + case GalImageFormat.G8R8 | GalImageFormat.Unorm: return (PixelInternalFormat.Rg8, PixelFormat.Rg, PixelType.UnsignedByte); case GalImageFormat.R16 | GalImageFormat.Sfloat: return (PixelInternalFormat.R16f, PixelFormat.Red, PixelType.HalfFloat); case GalImageFormat.R16 | GalImageFormat.Sint: return (PixelInternalFormat.R16i, PixelFormat.RedInteger, PixelType.Short); case GalImageFormat.R16 | GalImageFormat.Snorm: return (PixelInternalFormat.R16Snorm, PixelFormat.Red, PixelType.Byte); diff --git a/Ryujinx.Graphics/Texture/ImageUtils.cs b/Ryujinx.Graphics/Texture/ImageUtils.cs index 18a179fbfa..0381427579 100644 --- a/Ryujinx.Graphics/Texture/ImageUtils.cs +++ b/Ryujinx.Graphics/Texture/ImageUtils.cs @@ -104,7 +104,6 @@ namespace Ryujinx.Graphics.Texture { GalImageFormat.B5G6R5, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) }, { GalImageFormat.BC7, new ImageDescriptor(16, 4, 4, TargetBuffer.Color) }, { GalImageFormat.R16G16, new ImageDescriptor(4, 1, 1, TargetBuffer.Color) }, - { GalImageFormat.R8G8, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) }, { GalImageFormat.G8R8, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) }, { GalImageFormat.R16, new ImageDescriptor(2, 1, 1, TargetBuffer.Color) }, { GalImageFormat.R8, new ImageDescriptor(1, 1, 1, TargetBuffer.Color) }, @@ -188,8 +187,8 @@ namespace Ryujinx.Graphics.Texture case GalSurfaceFormat.RG16Float: return GalImageFormat.R16G16 | Sfloat; case GalSurfaceFormat.R11G11B10Float: return GalImageFormat.B10G11R11 | Sfloat; case GalSurfaceFormat.R32Float: return GalImageFormat.R32 | Sfloat; - case GalSurfaceFormat.RG8Unorm: return GalImageFormat.R8G8 | Unorm; - case GalSurfaceFormat.RG8Snorm: return GalImageFormat.R8 | Snorm; + case GalSurfaceFormat.RG8Unorm: return GalImageFormat.G8R8 | Unorm; + case GalSurfaceFormat.RG8Snorm: return GalImageFormat.G8R8 | Snorm; case GalSurfaceFormat.R16Float: return GalImageFormat.R16 | Sfloat; case GalSurfaceFormat.R16Unorm: return GalImageFormat.R16 | Unorm; case GalSurfaceFormat.R8Unorm: return GalImageFormat.R8 | Unorm;