From 98e6a34608cc31f1f40e964a4a8cc80606877eca Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Tue, 12 Jun 2018 14:29:44 +0200 Subject: [PATCH] Implement R16 texture format (#147) --- Ryujinx.Graphics/Gal/GalTextureFormat.cs | 1 + Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs | 1 + Ryujinx.HLE/Gpu/TextureHelper.cs | 1 + Ryujinx.HLE/Gpu/TextureReader.cs | 1 + 4 files changed, 4 insertions(+) diff --git a/Ryujinx.Graphics/Gal/GalTextureFormat.cs b/Ryujinx.Graphics/Gal/GalTextureFormat.cs index 3bac2f800..7d19dc26d 100644 --- a/Ryujinx.Graphics/Gal/GalTextureFormat.cs +++ b/Ryujinx.Graphics/Gal/GalTextureFormat.cs @@ -10,6 +10,7 @@ namespace Ryujinx.Graphics.Gal B5G6R5 = 0x15, BC7U = 0x17, G8R8 = 0x18, + R16 = 0x1b, R8 = 0x1d, BC1 = 0x24, BC2 = 0x25, diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs index 50b802c1a..c8000603a 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs @@ -66,6 +66,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL case GalTextureFormat.A1B5G5R5: return (PixelFormat.Rgba, PixelType.UnsignedShort5551); case GalTextureFormat.B5G6R5: return (PixelFormat.Rgb, PixelType.UnsignedShort565); case GalTextureFormat.G8R8: return (PixelFormat.Rg, PixelType.UnsignedByte); + case GalTextureFormat.R16: return (PixelFormat.Red, PixelType.HalfFloat); case GalTextureFormat.R8: return (PixelFormat.Red, PixelType.UnsignedByte); } diff --git a/Ryujinx.HLE/Gpu/TextureHelper.cs b/Ryujinx.HLE/Gpu/TextureHelper.cs index f1b3f0b38..e48e25ad8 100644 --- a/Ryujinx.HLE/Gpu/TextureHelper.cs +++ b/Ryujinx.HLE/Gpu/TextureHelper.cs @@ -33,6 +33,7 @@ namespace Ryujinx.HLE.Gpu case GalTextureFormat.A1B5G5R5: return Texture.Width * Texture.Height * 2; case GalTextureFormat.B5G6R5: return Texture.Width * Texture.Height * 2; case GalTextureFormat.G8R8: return Texture.Width * Texture.Height * 2; + case GalTextureFormat.R16: return Texture.Width * Texture.Height * 2; case GalTextureFormat.R8: return Texture.Width * Texture.Height; case GalTextureFormat.BC1: diff --git a/Ryujinx.HLE/Gpu/TextureReader.cs b/Ryujinx.HLE/Gpu/TextureReader.cs index 4436e07fd..9e9ff7834 100644 --- a/Ryujinx.HLE/Gpu/TextureReader.cs +++ b/Ryujinx.HLE/Gpu/TextureReader.cs @@ -17,6 +17,7 @@ namespace Ryujinx.HLE.Gpu case GalTextureFormat.A1B5G5R5: return Read5551 (Memory, Texture); case GalTextureFormat.B5G6R5: return Read565 (Memory, Texture); case GalTextureFormat.G8R8: return Read2Bpp (Memory, Texture); + case GalTextureFormat.R16: return Read2Bpp (Memory, Texture); case GalTextureFormat.R8: return Read1Bpp (Memory, Texture); case GalTextureFormat.BC7U: return Read16Bpt4x4(Memory, Texture); case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture);