Add the ZF32 texture format

This commit is contained in:
gdkchan 2018-07-09 14:54:36 -03:00
parent 430fcb822d
commit e730a27a19
4 changed files with 31 additions and 18 deletions

View file

@ -17,6 +17,7 @@ namespace Ryujinx.Graphics.Gal
BC3 = 0x26,
BC4 = 0x27,
BC5 = 0x28,
ZF32 = 0x2f,
Astc2D4x4 = 0x40,
Astc2D5x5 = 0x41,
Astc2D6x6 = 0x42,

View file

@ -129,15 +129,16 @@ namespace Ryujinx.Graphics.Gal.OpenGL
{
switch (Format)
{
case GalTextureFormat.R32G32B32A32: return (PixelFormat.Rgba, PixelType.Float);
case GalTextureFormat.R16G16B16A16: return (PixelFormat.Rgba, PixelType.HalfFloat);
case GalTextureFormat.A8B8G8R8: return (PixelFormat.Rgba, PixelType.UnsignedByte);
case GalTextureFormat.R32: return (PixelFormat.Red, PixelType.Float);
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);
case GalTextureFormat.R32G32B32A32: return (PixelFormat.Rgba, PixelType.Float);
case GalTextureFormat.R16G16B16A16: return (PixelFormat.Rgba, PixelType.HalfFloat);
case GalTextureFormat.A8B8G8R8: return (PixelFormat.Rgba, PixelType.UnsignedByte);
case GalTextureFormat.R32: return (PixelFormat.Red, PixelType.Float);
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);
case GalTextureFormat.ZF32: return (PixelFormat.DepthComponent, PixelType.Float);
}
throw new NotImplementedException(Format.ToString());

View file

@ -28,15 +28,25 @@ namespace Ryujinx.HLE.Gpu.Texture
{
switch (Texture.Format)
{
case GalTextureFormat.R32G32B32A32: return Texture.Width * Texture.Height * 16;
case GalTextureFormat.R16G16B16A16: return Texture.Width * Texture.Height * 8;
case GalTextureFormat.A8B8G8R8: return Texture.Width * Texture.Height * 4;
case GalTextureFormat.R32: return Texture.Width * Texture.Height * 4;
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.R32G32B32A32:
return Texture.Width * Texture.Height * 16;
case GalTextureFormat.R16G16B16A16:
return Texture.Width * Texture.Height * 8;
case GalTextureFormat.A8B8G8R8:
case GalTextureFormat.R32:
case GalTextureFormat.ZF32:
return Texture.Width * Texture.Height * 4;
case GalTextureFormat.A1B5G5R5:
case GalTextureFormat.B5G6R5:
case GalTextureFormat.G8R8:
case GalTextureFormat.R16:
return Texture.Width * Texture.Height * 2;
case GalTextureFormat.R8:
return Texture.Width * Texture.Height;
case GalTextureFormat.BC1:
case GalTextureFormat.BC4:

View file

@ -25,6 +25,7 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalTextureFormat.BC3: return Read16Bpt4x4(Memory, Texture);
case GalTextureFormat.BC4: return Read8Bpt4x4 (Memory, Texture);
case GalTextureFormat.BC5: return Read16Bpt4x4(Memory, Texture);
case GalTextureFormat.ZF32: return Read4Bpp (Memory, Texture);
case GalTextureFormat.Astc2D4x4: return Read16Bpt4x4(Memory, Texture);
}