Add the ZF32 texture format
This commit is contained in:
parent
430fcb822d
commit
e730a27a19
4 changed files with 31 additions and 18 deletions
|
@ -17,6 +17,7 @@ namespace Ryujinx.Graphics.Gal
|
||||||
BC3 = 0x26,
|
BC3 = 0x26,
|
||||||
BC4 = 0x27,
|
BC4 = 0x27,
|
||||||
BC5 = 0x28,
|
BC5 = 0x28,
|
||||||
|
ZF32 = 0x2f,
|
||||||
Astc2D4x4 = 0x40,
|
Astc2D4x4 = 0x40,
|
||||||
Astc2D5x5 = 0x41,
|
Astc2D5x5 = 0x41,
|
||||||
Astc2D6x6 = 0x42,
|
Astc2D6x6 = 0x42,
|
||||||
|
|
|
@ -129,15 +129,16 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
||||||
{
|
{
|
||||||
switch (Format)
|
switch (Format)
|
||||||
{
|
{
|
||||||
case GalTextureFormat.R32G32B32A32: return (PixelFormat.Rgba, PixelType.Float);
|
case GalTextureFormat.R32G32B32A32: return (PixelFormat.Rgba, PixelType.Float);
|
||||||
case GalTextureFormat.R16G16B16A16: return (PixelFormat.Rgba, PixelType.HalfFloat);
|
case GalTextureFormat.R16G16B16A16: return (PixelFormat.Rgba, PixelType.HalfFloat);
|
||||||
case GalTextureFormat.A8B8G8R8: return (PixelFormat.Rgba, PixelType.UnsignedByte);
|
case GalTextureFormat.A8B8G8R8: return (PixelFormat.Rgba, PixelType.UnsignedByte);
|
||||||
case GalTextureFormat.R32: return (PixelFormat.Red, PixelType.Float);
|
case GalTextureFormat.R32: return (PixelFormat.Red, PixelType.Float);
|
||||||
case GalTextureFormat.A1B5G5R5: return (PixelFormat.Rgba, PixelType.UnsignedShort5551);
|
case GalTextureFormat.A1B5G5R5: return (PixelFormat.Rgba, PixelType.UnsignedShort5551);
|
||||||
case GalTextureFormat.B5G6R5: return (PixelFormat.Rgb, PixelType.UnsignedShort565);
|
case GalTextureFormat.B5G6R5: return (PixelFormat.Rgb, PixelType.UnsignedShort565);
|
||||||
case GalTextureFormat.G8R8: return (PixelFormat.Rg, PixelType.UnsignedByte);
|
case GalTextureFormat.G8R8: return (PixelFormat.Rg, PixelType.UnsignedByte);
|
||||||
case GalTextureFormat.R16: return (PixelFormat.Red, PixelType.HalfFloat);
|
case GalTextureFormat.R16: return (PixelFormat.Red, PixelType.HalfFloat);
|
||||||
case GalTextureFormat.R8: return (PixelFormat.Red, PixelType.UnsignedByte);
|
case GalTextureFormat.R8: return (PixelFormat.Red, PixelType.UnsignedByte);
|
||||||
|
case GalTextureFormat.ZF32: return (PixelFormat.DepthComponent, PixelType.Float);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new NotImplementedException(Format.ToString());
|
throw new NotImplementedException(Format.ToString());
|
||||||
|
|
|
@ -28,15 +28,25 @@ namespace Ryujinx.HLE.Gpu.Texture
|
||||||
{
|
{
|
||||||
switch (Texture.Format)
|
switch (Texture.Format)
|
||||||
{
|
{
|
||||||
case GalTextureFormat.R32G32B32A32: return Texture.Width * Texture.Height * 16;
|
case GalTextureFormat.R32G32B32A32:
|
||||||
case GalTextureFormat.R16G16B16A16: return Texture.Width * Texture.Height * 8;
|
return Texture.Width * Texture.Height * 16;
|
||||||
case GalTextureFormat.A8B8G8R8: return Texture.Width * Texture.Height * 4;
|
|
||||||
case GalTextureFormat.R32: return Texture.Width * Texture.Height * 4;
|
case GalTextureFormat.R16G16B16A16:
|
||||||
case GalTextureFormat.A1B5G5R5: return Texture.Width * Texture.Height * 2;
|
return Texture.Width * Texture.Height * 8;
|
||||||
case GalTextureFormat.B5G6R5: return Texture.Width * Texture.Height * 2;
|
|
||||||
case GalTextureFormat.G8R8: return Texture.Width * Texture.Height * 2;
|
case GalTextureFormat.A8B8G8R8:
|
||||||
case GalTextureFormat.R16: return Texture.Width * Texture.Height * 2;
|
case GalTextureFormat.R32:
|
||||||
case GalTextureFormat.R8: return Texture.Width * Texture.Height;
|
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.BC1:
|
||||||
case GalTextureFormat.BC4:
|
case GalTextureFormat.BC4:
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace Ryujinx.HLE.Gpu.Texture
|
||||||
case GalTextureFormat.BC3: return Read16Bpt4x4(Memory, Texture);
|
case GalTextureFormat.BC3: return Read16Bpt4x4(Memory, Texture);
|
||||||
case GalTextureFormat.BC4: return Read8Bpt4x4 (Memory, Texture);
|
case GalTextureFormat.BC4: return Read8Bpt4x4 (Memory, Texture);
|
||||||
case GalTextureFormat.BC5: return Read16Bpt4x4(Memory, Texture);
|
case GalTextureFormat.BC5: return Read16Bpt4x4(Memory, Texture);
|
||||||
|
case GalTextureFormat.ZF32: return Read4Bpp (Memory, Texture);
|
||||||
case GalTextureFormat.Astc2D4x4: return Read16Bpt4x4(Memory, Texture);
|
case GalTextureFormat.Astc2D4x4: return Read16Bpt4x4(Memory, Texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue