aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal
diff options
context:
space:
mode:
authorHorrorTroll <sonicvipduc@gmail.com>2018-09-17 07:24:56 +0700
committerThomas Guillemard <thog@protonmail.com>2018-09-17 02:24:55 +0200
commit8a78a703f2e8e374286efaae575d87fb38242427 (patch)
treec0293f0e01cf8a820cdf6a8d2c5ccbc921dc2007 /Ryujinx.Graphics/Gal
parent46a11460d4701f66926f70b5dc394d209e877854 (diff)
Implement B5G6R5Unorm, BGR5A1Unorm, RGBA32Uint, R16Unorm and Z16 texture format. Fix BC6H_UF16 from Unorm to Sfloat (#417)
* Implement B5G6R5Unorm & BGR5A1Unorm * Implement RGBA32Uint * Implement R16Unorm & Z16 texture format * Fix BC6H_UF16 from Unorm to Sfloat
Diffstat (limited to 'Ryujinx.Graphics/Gal')
-rw-r--r--Ryujinx.Graphics/Gal/GalTextureFormat.cs1
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs20
2 files changed, 11 insertions, 10 deletions
diff --git a/Ryujinx.Graphics/Gal/GalTextureFormat.cs b/Ryujinx.Graphics/Gal/GalTextureFormat.cs
index 009d2b82..e8658595 100644
--- a/Ryujinx.Graphics/Gal/GalTextureFormat.cs
+++ b/Ryujinx.Graphics/Gal/GalTextureFormat.cs
@@ -26,6 +26,7 @@ namespace Ryujinx.Graphics.Gal
Z24S8 = 0x29,
ZF32 = 0x2f,
ZF32_X24S8 = 0x30,
+ Z16 = 0x3a,
Astc2D4x4 = 0x40,
Astc2D5x5 = 0x41,
Astc2D6x6 = 0x42,
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
index 69c133a3..876c7b99 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs
@@ -183,16 +183,16 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
switch (Format)
{
- case GalImageFormat.BC6H_UF16 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbBptcUnsignedFloat;
- case GalImageFormat.BC6H_SF16 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbBptcSignedFloat;
- case GalImageFormat.BC7 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaBptcUnorm;
- case GalImageFormat.BC1_RGBA | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaS3tcDxt1Ext;
- case GalImageFormat.BC2 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaS3tcDxt3Ext;
- case GalImageFormat.BC3 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaS3tcDxt5Ext;
- case GalImageFormat.BC4 | GalImageFormat.Snorm: return InternalFormat.CompressedSignedRedRgtc1;
- case GalImageFormat.BC4 | GalImageFormat.Unorm: return InternalFormat.CompressedRedRgtc1;
- case GalImageFormat.BC5 | GalImageFormat.Snorm: return InternalFormat.CompressedSignedRgRgtc2;
- case GalImageFormat.BC5 | GalImageFormat.Unorm: return InternalFormat.CompressedRgRgtc2;
+ case GalImageFormat.BC6H_UF16 | GalImageFormat.Sfloat: return InternalFormat.CompressedRgbBptcUnsignedFloat;
+ case GalImageFormat.BC6H_SF16 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbBptcSignedFloat;
+ case GalImageFormat.BC7 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaBptcUnorm;
+ case GalImageFormat.BC1_RGBA | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaS3tcDxt1Ext;
+ case GalImageFormat.BC2 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaS3tcDxt3Ext;
+ case GalImageFormat.BC3 | GalImageFormat.Unorm: return InternalFormat.CompressedRgbaS3tcDxt5Ext;
+ case GalImageFormat.BC4 | GalImageFormat.Snorm: return InternalFormat.CompressedSignedRedRgtc1;
+ case GalImageFormat.BC4 | GalImageFormat.Unorm: return InternalFormat.CompressedRedRgtc1;
+ case GalImageFormat.BC5 | GalImageFormat.Snorm: return InternalFormat.CompressedSignedRgRgtc2;
+ case GalImageFormat.BC5 | GalImageFormat.Unorm: return InternalFormat.CompressedRgRgtc2;
}
throw new NotImplementedException($"{Format & GalImageFormat.FormatMask} {Format & GalImageFormat.TypeMask}");