Implement Z24S8 TextureFormat (#247)

* add Z24S8 TextureFormat

* return correct PixelFormat & PixelType

* return correct texture size

* return correct Bytes Per Pixel

* Correct PixelType
This commit is contained in:
greggameplayer 2018-07-19 01:19:37 +02:00 committed by Ac_K
parent 2236f4b2c3
commit 0a13900bc9
4 changed files with 5 additions and 1 deletions

View File

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

View File

@ -139,6 +139,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
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); case GalTextureFormat.ZF32: return (PixelFormat.DepthComponent, PixelType.Float);
case GalTextureFormat.Z24S8: return (PixelFormat.DepthStencil, PixelType.UnsignedInt248);
} }
throw new NotImplementedException(Format.ToString()); throw new NotImplementedException(Format.ToString());

View File

@ -37,6 +37,7 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalTextureFormat.A8B8G8R8: case GalTextureFormat.A8B8G8R8:
case GalTextureFormat.R32: case GalTextureFormat.R32:
case GalTextureFormat.ZF32: case GalTextureFormat.ZF32:
case GalTextureFormat.Z24S8:
return Texture.Width * Texture.Height * 4; return Texture.Width * Texture.Height * 4;
case GalTextureFormat.A1B5G5R5: case GalTextureFormat.A1B5G5R5:

View File

@ -14,6 +14,7 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalTextureFormat.R16G16B16A16: return Read8Bpp (Memory, Texture); case GalTextureFormat.R16G16B16A16: return Read8Bpp (Memory, Texture);
case GalTextureFormat.A8B8G8R8: return Read4Bpp (Memory, Texture); case GalTextureFormat.A8B8G8R8: return Read4Bpp (Memory, Texture);
case GalTextureFormat.R32: return Read4Bpp (Memory, Texture); case GalTextureFormat.R32: return Read4Bpp (Memory, Texture);
case GalTextureFormat.Z24S8: return Read4Bpp (Memory, Texture);
case GalTextureFormat.A1B5G5R5: return Read5551 (Memory, Texture); case GalTextureFormat.A1B5G5R5: return Read5551 (Memory, Texture);
case GalTextureFormat.B5G6R5: return Read565 (Memory, Texture); case GalTextureFormat.B5G6R5: return Read565 (Memory, Texture);
case GalTextureFormat.G8R8: return Read2Bpp (Memory, Texture); case GalTextureFormat.G8R8: return Read2Bpp (Memory, Texture);