Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format
This commit is contained in:
parent
57dfa09e3a
commit
034d979dce
5 changed files with 17 additions and 6 deletions
|
@ -24,6 +24,7 @@ namespace Ryujinx.Graphics.Gal
|
|||
BC5 = 0x28,
|
||||
Z24S8 = 0x29,
|
||||
ZF32 = 0x2f,
|
||||
ZF32_X24S8 = 0x30,
|
||||
Astc2D4x4 = 0x40,
|
||||
Astc2D5x5 = 0x41,
|
||||
Astc2D6x6 = 0x42,
|
||||
|
|
|
@ -53,6 +53,7 @@ namespace Ryujinx.Graphics.Gal
|
|||
case GalTextureFormat.BC4: return GalImageFormat.BC4_UNORM_BLOCK;
|
||||
case GalTextureFormat.BC5: return GalImageFormat.BC5_UNORM_BLOCK;
|
||||
case GalTextureFormat.Z24S8: return GalImageFormat.D24_UNORM_S8_UINT;
|
||||
case GalTextureFormat.ZF32_X24S8: return GalImageFormat.D32_SFLOAT_S8_UINT;
|
||||
case GalTextureFormat.Astc2D4x4: return GalImageFormat.ASTC_4x4_UNORM_BLOCK;
|
||||
case GalTextureFormat.Astc2D5x5: return GalImageFormat.ASTC_5x5_UNORM_BLOCK;
|
||||
case GalTextureFormat.Astc2D6x6: return GalImageFormat.ASTC_6x6_UNORM_BLOCK;
|
||||
|
@ -142,6 +143,8 @@ namespace Ryujinx.Graphics.Gal
|
|||
case GalFrameBufferFormat.RG8Snorm: return GalImageFormat.R8_SNORM;
|
||||
case GalFrameBufferFormat.RGBA8Snorm: return GalImageFormat.A8B8G8R8_SNORM_PACK32;
|
||||
case GalFrameBufferFormat.RG8Unorm: return GalImageFormat.R8G8_UNORM;
|
||||
case GalFrameBufferFormat.BGRA8Unorm: return GalImageFormat.A8B8G8R8_UNORM_PACK32;
|
||||
case GalFrameBufferFormat.BGRA8Srgb: return GalImageFormat.A8B8G8R8_SRGB_PACK32;
|
||||
}
|
||||
|
||||
throw new NotImplementedException(Format.ToString());
|
||||
|
@ -151,9 +154,10 @@ namespace Ryujinx.Graphics.Gal
|
|||
{
|
||||
switch (Format)
|
||||
{
|
||||
case GalZetaFormat.Z32Float: return GalImageFormat.D32_SFLOAT;
|
||||
case GalZetaFormat.S8Z24Unorm: return GalImageFormat.D24_UNORM_S8_UINT;
|
||||
case GalZetaFormat.Z16Unorm: return GalImageFormat.D16_UNORM;
|
||||
case GalZetaFormat.Z32Float: return GalImageFormat.D32_SFLOAT;
|
||||
case GalZetaFormat.S8Z24Unorm: return GalImageFormat.D24_UNORM_S8_UINT;
|
||||
case GalZetaFormat.Z16Unorm: return GalImageFormat.D16_UNORM;
|
||||
case GalZetaFormat.Z32S8X24Float: return GalImageFormat.D32_SFLOAT_S8_UINT;
|
||||
}
|
||||
|
||||
throw new NotImplementedException(Format.ToString());
|
||||
|
@ -228,6 +232,7 @@ namespace Ryujinx.Graphics.Gal
|
|||
case GalImageFormat.D24_UNORM_S8_UINT:
|
||||
case GalImageFormat.D32_SFLOAT:
|
||||
case GalImageFormat.D16_UNORM:
|
||||
case GalImageFormat.D32_SFLOAT_S8_UINT:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -241,6 +246,7 @@ namespace Ryujinx.Graphics.Gal
|
|||
case GalImageFormat.D24_UNORM_S8_UINT:
|
||||
case GalImageFormat.D32_SFLOAT:
|
||||
case GalImageFormat.D16_UNORM:
|
||||
case GalImageFormat.D32_SFLOAT_S8_UINT:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -254,6 +260,7 @@ namespace Ryujinx.Graphics.Gal
|
|||
switch (Format)
|
||||
{
|
||||
case GalImageFormat.D24_UNORM_S8_UINT:
|
||||
case GalImageFormat.D32_SFLOAT_S8_UINT:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,9 +168,10 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|||
|
||||
case GalImageFormat.R4G4B4A4_UNORM_PACK16_REVERSED: return (PixelInternalFormat.Rgba4, PixelFormat.Rgba, PixelType.UnsignedShort4444Reversed);
|
||||
|
||||
case GalImageFormat.D24_UNORM_S8_UINT: return (PixelInternalFormat.Depth24Stencil8, PixelFormat.DepthStencil, PixelType.UnsignedInt248);
|
||||
case GalImageFormat.D32_SFLOAT: return (PixelInternalFormat.DepthComponent32f, PixelFormat.DepthComponent, PixelType.Float);
|
||||
case GalImageFormat.D16_UNORM: return (PixelInternalFormat.DepthComponent16, PixelFormat.DepthComponent, PixelType.UnsignedShort);
|
||||
case GalImageFormat.D24_UNORM_S8_UINT: return (PixelInternalFormat.Depth24Stencil8, PixelFormat.DepthStencil, PixelType.UnsignedInt248);
|
||||
case GalImageFormat.D32_SFLOAT: return (PixelInternalFormat.DepthComponent32f, PixelFormat.DepthComponent, PixelType.Float);
|
||||
case GalImageFormat.D16_UNORM: return (PixelInternalFormat.DepthComponent16, PixelFormat.DepthComponent, PixelType.UnsignedShort);
|
||||
case GalImageFormat.D32_SFLOAT_S8_UINT: return (PixelInternalFormat.Depth32fStencil8, PixelFormat.DepthStencil, PixelType.Float32UnsignedInt248Rev);
|
||||
}
|
||||
|
||||
throw new NotImplementedException(Format.ToString());
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace Ryujinx.HLE.Gpu.Texture
|
|||
case GalImageFormat.R16G16B16A16_SNORM:
|
||||
case GalImageFormat.R16G16B16A16_UINT:
|
||||
case GalImageFormat.R16G16B16A16_UNORM:
|
||||
case GalImageFormat.D32_SFLOAT_S8_UINT:
|
||||
return Image.Width * Image.Height * 8;
|
||||
|
||||
case GalImageFormat.A8B8G8R8_SINT_PACK32:
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace Ryujinx.HLE.Gpu.Texture
|
|||
case GalTextureFormat.BC4: return Read8Bpt4x4 (Memory, Texture);
|
||||
case GalTextureFormat.BC5: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
||||
case GalTextureFormat.ZF32: return Read4Bpp (Memory, Texture);
|
||||
case GalTextureFormat.ZF32_X24S8: return Read8Bpp (Memory, Texture);
|
||||
case GalTextureFormat.Astc2D4x4: return Read16BptCompressedTexture(Memory, Texture, 4, 4);
|
||||
case GalTextureFormat.Astc2D5x5: return Read16BptCompressedTexture(Memory, Texture, 5, 5);
|
||||
case GalTextureFormat.Astc2D6x6: return Read16BptCompressedTexture(Memory, Texture, 6, 6);
|
||||
|
|
Loading…
Add table
Reference in a new issue