mirror of
https://github.com/GreemDev/Ryujinx
synced 2024-12-26 13:56:41 +01:00
Implement BC6H_SF16 & BC6H_UF16 Texture Formats (#255)
* Implement BC6H_SF16 & BC6H_UF16 * correct coding style (1/5) * correct coding style (2/5) * correct coding style (3/5) * correct coding style (4/5) * correct coding style (5/5)
This commit is contained in:
parent
3e13b40b35
commit
e71da4fb74
5 changed files with 18 additions and 8 deletions
|
@ -6,6 +6,8 @@ namespace Ryujinx.Graphics.Gal
|
||||||
R16G16B16A16 = 0x3,
|
R16G16B16A16 = 0x3,
|
||||||
A8B8G8R8 = 0x8,
|
A8B8G8R8 = 0x8,
|
||||||
R32 = 0xf,
|
R32 = 0xf,
|
||||||
|
BC6H_SF16 = 0x10,
|
||||||
|
BC6H_UF16 = 0x11,
|
||||||
A1B5G5R5 = 0x14,
|
A1B5G5R5 = 0x14,
|
||||||
B5G6R5 = 0x15,
|
B5G6R5 = 0x15,
|
||||||
BC7U = 0x17,
|
BC7U = 0x17,
|
||||||
|
|
|
@ -148,12 +148,14 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
{
|
{
|
||||||
switch (Format)
|
switch (Format)
|
||||||
{
|
{
|
||||||
case GalTextureFormat.BC7U: return InternalFormat.CompressedRgbaBptcUnorm;
|
case GalTextureFormat.BC6H_UF16: return InternalFormat.CompressedRgbBptcUnsignedFloat;
|
||||||
case GalTextureFormat.BC1: return InternalFormat.CompressedRgbaS3tcDxt1Ext;
|
case GalTextureFormat.BC6H_SF16: return InternalFormat.CompressedRgbBptcSignedFloat;
|
||||||
case GalTextureFormat.BC2: return InternalFormat.CompressedRgbaS3tcDxt3Ext;
|
case GalTextureFormat.BC7U: return InternalFormat.CompressedRgbaBptcUnorm;
|
||||||
case GalTextureFormat.BC3: return InternalFormat.CompressedRgbaS3tcDxt5Ext;
|
case GalTextureFormat.BC1: return InternalFormat.CompressedRgbaS3tcDxt1Ext;
|
||||||
case GalTextureFormat.BC4: return InternalFormat.CompressedRedRgtc1;
|
case GalTextureFormat.BC2: return InternalFormat.CompressedRgbaS3tcDxt3Ext;
|
||||||
case GalTextureFormat.BC5: return InternalFormat.CompressedRgRgtc2;
|
case GalTextureFormat.BC3: return InternalFormat.CompressedRgbaS3tcDxt5Ext;
|
||||||
|
case GalTextureFormat.BC4: return InternalFormat.CompressedRedRgtc1;
|
||||||
|
case GalTextureFormat.BC5: return InternalFormat.CompressedRgRgtc2;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NotImplementedException(Format.ToString());
|
throw new NotImplementedException(Format.ToString());
|
||||||
|
@ -264,4 +266,4 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
throw new ArgumentException(nameof(BlendFactor));
|
throw new ArgumentException(nameof(BlendFactor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,6 +212,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
{
|
{
|
||||||
switch (Format)
|
switch (Format)
|
||||||
{
|
{
|
||||||
|
case GalTextureFormat.BC6H_UF16:
|
||||||
|
case GalTextureFormat.BC6H_SF16:
|
||||||
case GalTextureFormat.BC7U:
|
case GalTextureFormat.BC7U:
|
||||||
case GalTextureFormat.BC1:
|
case GalTextureFormat.BC1:
|
||||||
case GalTextureFormat.BC2:
|
case GalTextureFormat.BC2:
|
||||||
|
@ -224,4 +226,4 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,8 @@ namespace Ryujinx.HLE.Gpu.Texture
|
||||||
return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 8);
|
return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case GalTextureFormat.BC6H_SF16:
|
||||||
|
case GalTextureFormat.BC6H_UF16:
|
||||||
case GalTextureFormat.BC7U:
|
case GalTextureFormat.BC7U:
|
||||||
case GalTextureFormat.BC2:
|
case GalTextureFormat.BC2:
|
||||||
case GalTextureFormat.BC3:
|
case GalTextureFormat.BC3:
|
||||||
|
|
|
@ -19,6 +19,8 @@ namespace Ryujinx.HLE.Gpu.Texture
|
||||||
case GalTextureFormat.G8R8: return Read2Bpp (Memory, Texture);
|
case GalTextureFormat.G8R8: return Read2Bpp (Memory, Texture);
|
||||||
case GalTextureFormat.R16: return Read2Bpp (Memory, Texture);
|
case GalTextureFormat.R16: return Read2Bpp (Memory, Texture);
|
||||||
case GalTextureFormat.R8: return Read1Bpp (Memory, Texture);
|
case GalTextureFormat.R8: return Read1Bpp (Memory, Texture);
|
||||||
|
case GalTextureFormat.BC6H_SF16: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
||||||
|
case GalTextureFormat.BC6H_UF16: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
||||||
case GalTextureFormat.BC7U: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
case GalTextureFormat.BC7U: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
||||||
case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture);
|
case GalTextureFormat.BC1: return Read8Bpt4x4 (Memory, Texture);
|
||||||
case GalTextureFormat.BC2: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
case GalTextureFormat.BC2: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
||||||
|
|
Loading…
Reference in a new issue