1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-10-01 12:30:00 +02:00

Add R32_G32 texture format (#383)

This commit is contained in:
HorrorTroll 2018-08-27 21:18:21 +07:00 committed by gdkchan
parent 68300368d7
commit 27023e7afc
5 changed files with 17 additions and 0 deletions

View file

@ -4,6 +4,7 @@ namespace Ryujinx.Graphics.Gal
{ {
R32G32B32A32 = 0x1, R32G32B32A32 = 0x1,
R16G16B16A16 = 0x3, R16G16B16A16 = 0x3,
R32G32 = 0x4,
A8B8G8R8 = 0x8, A8B8G8R8 = 0x8,
A2B10G10R10 = 0x9, A2B10G10R10 = 0x9,
R32 = 0xf, R32 = 0xf,

View file

@ -75,6 +75,7 @@ namespace Ryujinx.Graphics.Gal
{ {
case GalTextureFormat.R32G32B32A32: return GalImageFormat.R32G32B32A32_SINT; case GalTextureFormat.R32G32B32A32: return GalImageFormat.R32G32B32A32_SINT;
case GalTextureFormat.R16G16B16A16: return GalImageFormat.R16G16B16A16_SINT; case GalTextureFormat.R16G16B16A16: return GalImageFormat.R16G16B16A16_SINT;
case GalTextureFormat.R32G32: return GalImageFormat.R32G32_SINT;
case GalTextureFormat.A8B8G8R8: return GalImageFormat.A8B8G8R8_SINT_PACK32; case GalTextureFormat.A8B8G8R8: return GalImageFormat.A8B8G8R8_SINT_PACK32;
case GalTextureFormat.A2B10G10R10: return GalImageFormat.A2B10G10R10_SINT_PACK32; case GalTextureFormat.A2B10G10R10: return GalImageFormat.A2B10G10R10_SINT_PACK32;
case GalTextureFormat.R32: return GalImageFormat.R32_SINT; case GalTextureFormat.R32: return GalImageFormat.R32_SINT;
@ -89,6 +90,7 @@ namespace Ryujinx.Graphics.Gal
{ {
case GalTextureFormat.R32G32B32A32: return GalImageFormat.R32G32B32A32_UINT; case GalTextureFormat.R32G32B32A32: return GalImageFormat.R32G32B32A32_UINT;
case GalTextureFormat.R16G16B16A16: return GalImageFormat.R16G16B16A16_UINT; case GalTextureFormat.R16G16B16A16: return GalImageFormat.R16G16B16A16_UINT;
case GalTextureFormat.R32G32: return GalImageFormat.R32G32_UINT;
case GalTextureFormat.A8B8G8R8: return GalImageFormat.A8B8G8R8_UINT_PACK32; case GalTextureFormat.A8B8G8R8: return GalImageFormat.A8B8G8R8_UINT_PACK32;
case GalTextureFormat.A2B10G10R10: return GalImageFormat.A2B10G10R10_UINT_PACK32; case GalTextureFormat.A2B10G10R10: return GalImageFormat.A2B10G10R10_UINT_PACK32;
case GalTextureFormat.R32: return GalImageFormat.R32_UINT; case GalTextureFormat.R32: return GalImageFormat.R32_UINT;
@ -111,6 +113,7 @@ namespace Ryujinx.Graphics.Gal
{ {
case GalTextureFormat.R32G32B32A32: return GalImageFormat.R32G32B32A32_SFLOAT; case GalTextureFormat.R32G32B32A32: return GalImageFormat.R32G32B32A32_SFLOAT;
case GalTextureFormat.R16G16B16A16: return GalImageFormat.R16G16B16A16_SFLOAT; case GalTextureFormat.R16G16B16A16: return GalImageFormat.R16G16B16A16_SFLOAT;
case GalTextureFormat.R32G32: return GalImageFormat.R32G32_SFLOAT;
case GalTextureFormat.R32: return GalImageFormat.R32_SFLOAT; case GalTextureFormat.R32: return GalImageFormat.R32_SFLOAT;
case GalTextureFormat.BC6H_SF16: return GalImageFormat.BC6H_SFLOAT_BLOCK; case GalTextureFormat.BC6H_SF16: return GalImageFormat.BC6H_SFLOAT_BLOCK;
case GalTextureFormat.BC6H_UF16: return GalImageFormat.BC6H_UFLOAT_BLOCK; case GalTextureFormat.BC6H_UF16: return GalImageFormat.BC6H_UFLOAT_BLOCK;
@ -142,6 +145,9 @@ namespace Ryujinx.Graphics.Gal
case GalFrameBufferFormat.RG8Snorm: return GalImageFormat.R8_SNORM; case GalFrameBufferFormat.RG8Snorm: return GalImageFormat.R8_SNORM;
case GalFrameBufferFormat.RGBA8Snorm: return GalImageFormat.A8B8G8R8_SNORM_PACK32; case GalFrameBufferFormat.RGBA8Snorm: return GalImageFormat.A8B8G8R8_SNORM_PACK32;
case GalFrameBufferFormat.RG8Unorm: return GalImageFormat.R8G8_UNORM; case GalFrameBufferFormat.RG8Unorm: return GalImageFormat.R8G8_UNORM;
case GalFrameBufferFormat.RG32Float: return GalImageFormat.R32G32_SFLOAT;
case GalFrameBufferFormat.RG32Sint: return GalImageFormat.R32G32_SINT;
case GalFrameBufferFormat.RG32Uint: return GalImageFormat.R32G32_UINT;
} }
throw new NotImplementedException(Format.ToString()); throw new NotImplementedException(Format.ToString());
@ -169,6 +175,9 @@ namespace Ryujinx.Graphics.Gal
case GalImageFormat.R16G16B16A16_SFLOAT: case GalImageFormat.R16G16B16A16_SFLOAT:
case GalImageFormat.R16G16B16A16_SINT: case GalImageFormat.R16G16B16A16_SINT:
case GalImageFormat.R16G16B16A16_UINT: case GalImageFormat.R16G16B16A16_UINT:
case GalImageFormat.R32G32_SFLOAT:
case GalImageFormat.R32G32_SINT:
case GalImageFormat.R32G32_UINT:
case GalImageFormat.A8B8G8R8_SNORM_PACK32: case GalImageFormat.A8B8G8R8_SNORM_PACK32:
case GalImageFormat.A8B8G8R8_UNORM_PACK32: case GalImageFormat.A8B8G8R8_UNORM_PACK32:
case GalImageFormat.A8B8G8R8_SINT_PACK32: case GalImageFormat.A8B8G8R8_SINT_PACK32:

View file

@ -135,6 +135,9 @@ namespace Ryujinx.Graphics.Gal.OpenGL
case GalImageFormat.R16G16B16A16_SFLOAT: return (PixelInternalFormat.Rgba16f, PixelFormat.Rgba, PixelType.HalfFloat); case GalImageFormat.R16G16B16A16_SFLOAT: return (PixelInternalFormat.Rgba16f, PixelFormat.Rgba, PixelType.HalfFloat);
case GalImageFormat.R16G16B16A16_SINT: return (PixelInternalFormat.Rgba16i, PixelFormat.RgbaInteger, PixelType.Short); case GalImageFormat.R16G16B16A16_SINT: return (PixelInternalFormat.Rgba16i, PixelFormat.RgbaInteger, PixelType.Short);
case GalImageFormat.R16G16B16A16_UINT: return (PixelInternalFormat.Rgba16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort); case GalImageFormat.R16G16B16A16_UINT: return (PixelInternalFormat.Rgba16ui, PixelFormat.RgbaInteger, PixelType.UnsignedShort);
case GalImageFormat.R32G32_SFLOAT: return (PixelInternalFormat.Rg32f, PixelFormat.Rg, PixelType.Float);
case GalImageFormat.R32G32_SINT: return (PixelInternalFormat.Rg32i, PixelFormat.RgInteger, PixelType.Int);
case GalImageFormat.R32G32_UINT: return (PixelInternalFormat.Rg32ui, PixelFormat.RgInteger, PixelType.UnsignedInt);
case GalImageFormat.A8B8G8R8_SNORM_PACK32: return (PixelInternalFormat.Rgba8Snorm, PixelFormat.Rgba, PixelType.Byte); case GalImageFormat.A8B8G8R8_SNORM_PACK32: return (PixelInternalFormat.Rgba8Snorm, PixelFormat.Rgba, PixelType.Byte);
case GalImageFormat.A8B8G8R8_UNORM_PACK32: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte); case GalImageFormat.A8B8G8R8_UNORM_PACK32: return (PixelInternalFormat.Rgba8, PixelFormat.Rgba, PixelType.UnsignedByte);
case GalImageFormat.A8B8G8R8_SINT_PACK32: return (PixelInternalFormat.Rgba8i, PixelFormat.RgbaInteger, PixelType.Byte); case GalImageFormat.A8B8G8R8_SINT_PACK32: return (PixelInternalFormat.Rgba8i, PixelFormat.RgbaInteger, PixelType.Byte);

View file

@ -44,6 +44,9 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalImageFormat.R16G16B16A16_SNORM: case GalImageFormat.R16G16B16A16_SNORM:
case GalImageFormat.R16G16B16A16_UINT: case GalImageFormat.R16G16B16A16_UINT:
case GalImageFormat.R16G16B16A16_UNORM: case GalImageFormat.R16G16B16A16_UNORM:
case GalImageFormat.R32G32_SFLOAT:
case GalImageFormat.R32G32_SINT:
case GalImageFormat.R32G32_UINT:
return Image.Width * Image.Height * 8; return Image.Width * Image.Height * 8;
case GalImageFormat.A8B8G8R8_SINT_PACK32: case GalImageFormat.A8B8G8R8_SINT_PACK32:

View file

@ -12,6 +12,7 @@ namespace Ryujinx.HLE.Gpu.Texture
{ {
case GalTextureFormat.R32G32B32A32: return Read16Bpp (Memory, Texture); case GalTextureFormat.R32G32B32A32: return Read16Bpp (Memory, Texture);
case GalTextureFormat.R16G16B16A16: return Read8Bpp (Memory, Texture); case GalTextureFormat.R16G16B16A16: return Read8Bpp (Memory, Texture);
case GalTextureFormat.R32G32: return Read8Bpp (Memory, Texture);
case GalTextureFormat.A8B8G8R8: return Read4Bpp (Memory, Texture); case GalTextureFormat.A8B8G8R8: return Read4Bpp (Memory, Texture);
case GalTextureFormat.A2B10G10R10: return Read4Bpp (Memory, Texture); case GalTextureFormat.A2B10G10R10: return Read4Bpp (Memory, Texture);
case GalTextureFormat.R32: return Read4Bpp (Memory, Texture); case GalTextureFormat.R32: return Read4Bpp (Memory, Texture);