Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format (#377)

* Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format

* Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format

* Revert "Add BGRA8Unorm, BGRA8Srgb, ZF32_X24S8 texture format"

This reverts commit aea5c9db3a5e0b11545c3520f885e411a3587113.

* Conflicts fix

* Wrong fix

* E

* e
This commit is contained in:
HorrorTroll 2018-09-02 04:25:49 +07:00 committed by gdkchan
parent 35778afef9
commit bf28d8f1aa
5 changed files with 17 additions and 6 deletions

View File

@ -25,6 +25,7 @@ namespace Ryujinx.Graphics.Gal
BC5 = 0x28,
Z24S8 = 0x29,
ZF32 = 0x2f,
ZF32_X24S8 = 0x30,
Astc2D4x4 = 0x40,
Astc2D5x5 = 0x41,
Astc2D6x6 = 0x42,

View File

@ -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;
@ -145,6 +146,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;
case GalFrameBufferFormat.RG32Float: return GalImageFormat.R32G32_SFLOAT;
case GalFrameBufferFormat.RG32Sint: return GalImageFormat.R32G32_SINT;
case GalFrameBufferFormat.RG32Uint: return GalImageFormat.R32G32_UINT;
@ -157,9 +160,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());
@ -237,6 +241,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 false;
}
@ -250,6 +255,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;
}
@ -263,6 +269,7 @@ namespace Ryujinx.Graphics.Gal
switch (Format)
{
case GalImageFormat.D24_UNORM_S8_UINT:
case GalImageFormat.D32_SFLOAT_S8_UINT:
return true;
}

View File

@ -171,9 +171,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());

View File

@ -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:
case GalImageFormat.R32G32_SFLOAT:
case GalImageFormat.R32G32_SINT:
case GalImageFormat.R32G32_UINT:

View File

@ -33,6 +33,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);