aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/FormatTable.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2020-09-11 00:48:48 +0100
committerGitHub <noreply@github.com>2020-09-11 09:48:48 +1000
commit3d055da5fc77f462e9c7099e08570213c0220cd4 (patch)
tree0f1fea8ba0385ff4672b783fd536e35bb91a2069 /Ryujinx.Graphics.Gpu/Image/FormatTable.cs
parent5d69d9103ef423719619658dc3378869692a5064 (diff)
Allow swizzles to match with "undefined" components (#1538)
* Add swizzle matching rules. Improves rules which try to match incompatible formats as perfect, such as D32 float -> R32 float. Remove Format.HasOneComponent, since this information is now available via the FormatInfo struct. * Fix this rule. * Update component counts for depth formats.
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/FormatTable.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/FormatTable.cs192
1 files changed, 96 insertions, 96 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/FormatTable.cs b/Ryujinx.Graphics.Gpu/Image/FormatTable.cs
index 9f8b0fa0..d8f2a9d4 100644
--- a/Ryujinx.Graphics.Gpu/Image/FormatTable.cs
+++ b/Ryujinx.Graphics.Gpu/Image/FormatTable.cs
@@ -10,102 +10,102 @@ namespace Ryujinx.Graphics.Gpu.Image
{
private static Dictionary<uint, FormatInfo> _textureFormats = new Dictionary<uint, FormatInfo>()
{
- { 0x2491d, new FormatInfo(Format.R8Unorm, 1, 1, 1) },
- { 0x1249d, new FormatInfo(Format.R8Snorm, 1, 1, 1) },
- { 0x4921d, new FormatInfo(Format.R8Uint, 1, 1, 1) },
- { 0x36d9d, new FormatInfo(Format.R8Sint, 1, 1, 1) },
- { 0x7ff9b, new FormatInfo(Format.R16Float, 1, 1, 2) },
- { 0x2491b, new FormatInfo(Format.R16Unorm, 1, 1, 2) },
- { 0x1249b, new FormatInfo(Format.R16Snorm, 1, 1, 2) },
- { 0x4921b, new FormatInfo(Format.R16Uint, 1, 1, 2) },
- { 0x36d9b, new FormatInfo(Format.R16Sint, 1, 1, 2) },
- { 0x7ff8f, new FormatInfo(Format.R32Float, 1, 1, 4) },
- { 0x4920f, new FormatInfo(Format.R32Uint, 1, 1, 4) },
- { 0x36d8f, new FormatInfo(Format.R32Sint, 1, 1, 4) },
- { 0x24918, new FormatInfo(Format.R8G8Unorm, 1, 1, 2) },
- { 0x12498, new FormatInfo(Format.R8G8Snorm, 1, 1, 2) },
- { 0x49218, new FormatInfo(Format.R8G8Uint, 1, 1, 2) },
- { 0x36d98, new FormatInfo(Format.R8G8Sint, 1, 1, 2) },
- { 0x7ff8c, new FormatInfo(Format.R16G16Float, 1, 1, 4) },
- { 0x2490c, new FormatInfo(Format.R16G16Unorm, 1, 1, 4) },
- { 0x1248c, new FormatInfo(Format.R16G16Snorm, 1, 1, 4) },
- { 0x4920c, new FormatInfo(Format.R16G16Uint, 1, 1, 4) },
- { 0x36d8c, new FormatInfo(Format.R16G16Sint, 1, 1, 4) },
- { 0x7ff84, new FormatInfo(Format.R32G32Float, 1, 1, 8) },
- { 0x49204, new FormatInfo(Format.R32G32Uint, 1, 1, 8) },
- { 0x36d84, new FormatInfo(Format.R32G32Sint, 1, 1, 8) },
- { 0x7ff82, new FormatInfo(Format.R32G32B32Float, 1, 1, 12) },
- { 0x49202, new FormatInfo(Format.R32G32B32Uint, 1, 1, 12) },
- { 0x36d82, new FormatInfo(Format.R32G32B32Sint, 1, 1, 12) },
- { 0x24908, new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4) },
- { 0x12488, new FormatInfo(Format.R8G8B8A8Snorm, 1, 1, 4) },
- { 0x49208, new FormatInfo(Format.R8G8B8A8Uint, 1, 1, 4) },
- { 0x36d88, new FormatInfo(Format.R8G8B8A8Sint, 1, 1, 4) },
- { 0x7ff83, new FormatInfo(Format.R16G16B16A16Float, 1, 1, 8) },
- { 0x24903, new FormatInfo(Format.R16G16B16A16Unorm, 1, 1, 8) },
- { 0x12483, new FormatInfo(Format.R16G16B16A16Snorm, 1, 1, 8) },
- { 0x49203, new FormatInfo(Format.R16G16B16A16Uint, 1, 1, 8) },
- { 0x36d83, new FormatInfo(Format.R16G16B16A16Sint, 1, 1, 8) },
- { 0x7ff81, new FormatInfo(Format.R32G32B32A32Float, 1, 1, 16) },
- { 0x49201, new FormatInfo(Format.R32G32B32A32Uint, 1, 1, 16) },
- { 0x36d81, new FormatInfo(Format.R32G32B32A32Sint, 1, 1, 16) },
- { 0x2493a, new FormatInfo(Format.D16Unorm, 1, 1, 2) },
- { 0x7ffaf, new FormatInfo(Format.D32Float, 1, 1, 4) },
- { 0x24a0e, new FormatInfo(Format.D24UnormS8Uint, 1, 1, 4) },
- { 0x24a29, new FormatInfo(Format.D24UnormS8Uint, 1, 1, 4) },
- { 0x25385, new FormatInfo(Format.D32FloatS8Uint, 1, 1, 8) },
- { 0x253b0, new FormatInfo(Format.D32FloatS8Uint, 1, 1, 8) },
- { 0xa4908, new FormatInfo(Format.R8G8B8A8Srgb, 1, 1, 4) },
- { 0x24912, new FormatInfo(Format.R4G4B4A4Unorm, 1, 1, 2) },
- { 0x24914, new FormatInfo(Format.R5G5B5A1Unorm, 1, 1, 2) },
- { 0x24915, new FormatInfo(Format.R5G6B5Unorm, 1, 1, 2) },
- { 0x24909, new FormatInfo(Format.R10G10B10A2Unorm, 1, 1, 4) },
- { 0x49209, new FormatInfo(Format.R10G10B10A2Uint, 1, 1, 4) },
- { 0x7ffa1, new FormatInfo(Format.R11G11B10Float, 1, 1, 4) },
- { 0x7ffa0, new FormatInfo(Format.R9G9B9E5Float, 1, 1, 4) },
- { 0x24924, new FormatInfo(Format.Bc1RgbaUnorm, 4, 4, 8) },
- { 0x24925, new FormatInfo(Format.Bc2Unorm, 4, 4, 16) },
- { 0x24926, new FormatInfo(Format.Bc3Unorm, 4, 4, 16) },
- { 0xa4924, new FormatInfo(Format.Bc1RgbaSrgb, 4, 4, 8) },
- { 0xa4925, new FormatInfo(Format.Bc2Srgb, 4, 4, 16) },
- { 0xa4926, new FormatInfo(Format.Bc3Srgb, 4, 4, 16) },
- { 0x24927, new FormatInfo(Format.Bc4Unorm, 4, 4, 8) },
- { 0x124a7, new FormatInfo(Format.Bc4Snorm, 4, 4, 8) },
- { 0x24928, new FormatInfo(Format.Bc5Unorm, 4, 4, 16) },
- { 0x124a8, new FormatInfo(Format.Bc5Snorm, 4, 4, 16) },
- { 0x24917, new FormatInfo(Format.Bc7Unorm, 4, 4, 16) },
- { 0xa4917, new FormatInfo(Format.Bc7Srgb, 4, 4, 16) },
- { 0x7ff90, new FormatInfo(Format.Bc6HSfloat, 4, 4, 16) },
- { 0x7ff91, new FormatInfo(Format.Bc6HUfloat, 4, 4, 16) },
- { 0x24940, new FormatInfo(Format.Astc4x4Unorm, 4, 4, 16) },
- { 0x24950, new FormatInfo(Format.Astc5x4Unorm, 5, 4, 16) },
- { 0x24941, new FormatInfo(Format.Astc5x5Unorm, 5, 5, 16) },
- { 0x24951, new FormatInfo(Format.Astc6x5Unorm, 6, 5, 16) },
- { 0x24942, new FormatInfo(Format.Astc6x6Unorm, 6, 6, 16) },
- { 0x24955, new FormatInfo(Format.Astc8x5Unorm, 8, 5, 16) },
- { 0x24952, new FormatInfo(Format.Astc8x6Unorm, 8, 6, 16) },
- { 0x24944, new FormatInfo(Format.Astc8x8Unorm, 8, 8, 16) },
- { 0x24956, new FormatInfo(Format.Astc10x5Unorm, 10, 5, 16) },
- { 0x24957, new FormatInfo(Format.Astc10x6Unorm, 10, 6, 16) },
- { 0x24953, new FormatInfo(Format.Astc10x8Unorm, 10, 8, 16) },
- { 0x24945, new FormatInfo(Format.Astc10x10Unorm, 10, 10, 16) },
- { 0x24954, new FormatInfo(Format.Astc12x10Unorm, 12, 10, 16) },
- { 0x24946, new FormatInfo(Format.Astc12x12Unorm, 12, 12, 16) },
- { 0xa4940, new FormatInfo(Format.Astc4x4Srgb, 4, 4, 16) },
- { 0xa4950, new FormatInfo(Format.Astc5x4Srgb, 5, 4, 16) },
- { 0xa4941, new FormatInfo(Format.Astc5x5Srgb, 5, 5, 16) },
- { 0xa4951, new FormatInfo(Format.Astc6x5Srgb, 6, 5, 16) },
- { 0xa4942, new FormatInfo(Format.Astc6x6Srgb, 6, 6, 16) },
- { 0xa4955, new FormatInfo(Format.Astc8x5Srgb, 8, 5, 16) },
- { 0xa4952, new FormatInfo(Format.Astc8x6Srgb, 8, 6, 16) },
- { 0xa4944, new FormatInfo(Format.Astc8x8Srgb, 8, 8, 16) },
- { 0xa4956, new FormatInfo(Format.Astc10x5Srgb, 10, 5, 16) },
- { 0xa4957, new FormatInfo(Format.Astc10x6Srgb, 10, 6, 16) },
- { 0xa4953, new FormatInfo(Format.Astc10x8Srgb, 10, 8, 16) },
- { 0xa4945, new FormatInfo(Format.Astc10x10Srgb, 10, 10, 16) },
- { 0xa4954, new FormatInfo(Format.Astc12x10Srgb, 12, 10, 16) },
- { 0xa4946, new FormatInfo(Format.Astc12x12Srgb, 12, 12, 16) },
- { 0x24913, new FormatInfo(Format.A1B5G5R5Unorm, 1, 1, 2) }
+ { 0x2491d, new FormatInfo(Format.R8Unorm, 1, 1, 1, 1) },
+ { 0x1249d, new FormatInfo(Format.R8Snorm, 1, 1, 1, 1) },
+ { 0x4921d, new FormatInfo(Format.R8Uint, 1, 1, 1, 1) },
+ { 0x36d9d, new FormatInfo(Format.R8Sint, 1, 1, 1, 1) },
+ { 0x7ff9b, new FormatInfo(Format.R16Float, 1, 1, 2, 1) },
+ { 0x2491b, new FormatInfo(Format.R16Unorm, 1, 1, 2, 1) },
+ { 0x1249b, new FormatInfo(Format.R16Snorm, 1, 1, 2, 1) },
+ { 0x4921b, new FormatInfo(Format.R16Uint, 1, 1, 2, 1) },
+ { 0x36d9b, new FormatInfo(Format.R16Sint, 1, 1, 2, 1) },
+ { 0x7ff8f, new FormatInfo(Format.R32Float, 1, 1, 4, 1) },
+ { 0x4920f, new FormatInfo(Format.R32Uint, 1, 1, 4, 1) },
+ { 0x36d8f, new FormatInfo(Format.R32Sint, 1, 1, 4, 1) },
+ { 0x24918, new FormatInfo(Format.R8G8Unorm, 1, 1, 2, 2) },
+ { 0x12498, new FormatInfo(Format.R8G8Snorm, 1, 1, 2, 2) },
+ { 0x49218, new FormatInfo(Format.R8G8Uint, 1, 1, 2, 2) },
+ { 0x36d98, new FormatInfo(Format.R8G8Sint, 1, 1, 2, 2) },
+ { 0x7ff8c, new FormatInfo(Format.R16G16Float, 1, 1, 4, 2) },
+ { 0x2490c, new FormatInfo(Format.R16G16Unorm, 1, 1, 4, 2) },
+ { 0x1248c, new FormatInfo(Format.R16G16Snorm, 1, 1, 4, 2) },
+ { 0x4920c, new FormatInfo(Format.R16G16Uint, 1, 1, 4, 2) },
+ { 0x36d8c, new FormatInfo(Format.R16G16Sint, 1, 1, 4, 2) },
+ { 0x7ff84, new FormatInfo(Format.R32G32Float, 1, 1, 8, 2) },
+ { 0x49204, new FormatInfo(Format.R32G32Uint, 1, 1, 8, 2) },
+ { 0x36d84, new FormatInfo(Format.R32G32Sint, 1, 1, 8, 2) },
+ { 0x7ff82, new FormatInfo(Format.R32G32B32Float, 1, 1, 12, 3) },
+ { 0x49202, new FormatInfo(Format.R32G32B32Uint, 1, 1, 12, 3) },
+ { 0x36d82, new FormatInfo(Format.R32G32B32Sint, 1, 1, 12, 3) },
+ { 0x24908, new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4, 4) },
+ { 0x12488, new FormatInfo(Format.R8G8B8A8Snorm, 1, 1, 4, 4) },
+ { 0x49208, new FormatInfo(Format.R8G8B8A8Uint, 1, 1, 4, 4) },
+ { 0x36d88, new FormatInfo(Format.R8G8B8A8Sint, 1, 1, 4, 4) },
+ { 0x7ff83, new FormatInfo(Format.R16G16B16A16Float, 1, 1, 8, 4) },
+ { 0x24903, new FormatInfo(Format.R16G16B16A16Unorm, 1, 1, 8, 4) },
+ { 0x12483, new FormatInfo(Format.R16G16B16A16Snorm, 1, 1, 8, 4) },
+ { 0x49203, new FormatInfo(Format.R16G16B16A16Uint, 1, 1, 8, 4) },
+ { 0x36d83, new FormatInfo(Format.R16G16B16A16Sint, 1, 1, 8, 4) },
+ { 0x7ff81, new FormatInfo(Format.R32G32B32A32Float, 1, 1, 16, 4) },
+ { 0x49201, new FormatInfo(Format.R32G32B32A32Uint, 1, 1, 16, 4) },
+ { 0x36d81, new FormatInfo(Format.R32G32B32A32Sint, 1, 1, 16, 4) },
+ { 0x2493a, new FormatInfo(Format.D16Unorm, 1, 1, 2, 1) },
+ { 0x7ffaf, new FormatInfo(Format.D32Float, 1, 1, 4, 1) },
+ { 0x24a0e, new FormatInfo(Format.D24UnormS8Uint, 1, 1, 4, 2) },
+ { 0x24a29, new FormatInfo(Format.D24UnormS8Uint, 1, 1, 4, 2) },
+ { 0x25385, new FormatInfo(Format.D32FloatS8Uint, 1, 1, 8, 2) },
+ { 0x253b0, new FormatInfo(Format.D32FloatS8Uint, 1, 1, 8, 2) },
+ { 0xa4908, new FormatInfo(Format.R8G8B8A8Srgb, 1, 1, 4, 4) },
+ { 0x24912, new FormatInfo(Format.R4G4B4A4Unorm, 1, 1, 2, 4) },
+ { 0x24914, new FormatInfo(Format.R5G5B5A1Unorm, 1, 1, 2, 4) },
+ { 0x24915, new FormatInfo(Format.R5G6B5Unorm, 1, 1, 2, 3) },
+ { 0x24909, new FormatInfo(Format.R10G10B10A2Unorm, 1, 1, 4, 4) },
+ { 0x49209, new FormatInfo(Format.R10G10B10A2Uint, 1, 1, 4, 4) },
+ { 0x7ffa1, new FormatInfo(Format.R11G11B10Float, 1, 1, 4, 3) },
+ { 0x7ffa0, new FormatInfo(Format.R9G9B9E5Float, 1, 1, 4, 4) },
+ { 0x24924, new FormatInfo(Format.Bc1RgbaUnorm, 4, 4, 8, 4) },
+ { 0x24925, new FormatInfo(Format.Bc2Unorm, 4, 4, 16, 4) },
+ { 0x24926, new FormatInfo(Format.Bc3Unorm, 4, 4, 16, 4) },
+ { 0xa4924, new FormatInfo(Format.Bc1RgbaSrgb, 4, 4, 8, 4) },
+ { 0xa4925, new FormatInfo(Format.Bc2Srgb, 4, 4, 16, 4) },
+ { 0xa4926, new FormatInfo(Format.Bc3Srgb, 4, 4, 16, 4) },
+ { 0x24927, new FormatInfo(Format.Bc4Unorm, 4, 4, 8, 1) },
+ { 0x124a7, new FormatInfo(Format.Bc4Snorm, 4, 4, 8, 1) },
+ { 0x24928, new FormatInfo(Format.Bc5Unorm, 4, 4, 16, 2) },
+ { 0x124a8, new FormatInfo(Format.Bc5Snorm, 4, 4, 16, 2) },
+ { 0x24917, new FormatInfo(Format.Bc7Unorm, 4, 4, 16, 4) },
+ { 0xa4917, new FormatInfo(Format.Bc7Srgb, 4, 4, 16, 4) },
+ { 0x7ff90, new FormatInfo(Format.Bc6HSfloat, 4, 4, 16, 4) },
+ { 0x7ff91, new FormatInfo(Format.Bc6HUfloat, 4, 4, 16, 4) },
+ { 0x24940, new FormatInfo(Format.Astc4x4Unorm, 4, 4, 16, 4) },
+ { 0x24950, new FormatInfo(Format.Astc5x4Unorm, 5, 4, 16, 4) },
+ { 0x24941, new FormatInfo(Format.Astc5x5Unorm, 5, 5, 16, 4) },
+ { 0x24951, new FormatInfo(Format.Astc6x5Unorm, 6, 5, 16, 4) },
+ { 0x24942, new FormatInfo(Format.Astc6x6Unorm, 6, 6, 16, 4) },
+ { 0x24955, new FormatInfo(Format.Astc8x5Unorm, 8, 5, 16, 4) },
+ { 0x24952, new FormatInfo(Format.Astc8x6Unorm, 8, 6, 16, 4) },
+ { 0x24944, new FormatInfo(Format.Astc8x8Unorm, 8, 8, 16, 4) },
+ { 0x24956, new FormatInfo(Format.Astc10x5Unorm, 10, 5, 16, 4) },
+ { 0x24957, new FormatInfo(Format.Astc10x6Unorm, 10, 6, 16, 4) },
+ { 0x24953, new FormatInfo(Format.Astc10x8Unorm, 10, 8, 16, 4) },
+ { 0x24945, new FormatInfo(Format.Astc10x10Unorm, 10, 10, 16, 4) },
+ { 0x24954, new FormatInfo(Format.Astc12x10Unorm, 12, 10, 16, 4) },
+ { 0x24946, new FormatInfo(Format.Astc12x12Unorm, 12, 12, 16, 4) },
+ { 0xa4940, new FormatInfo(Format.Astc4x4Srgb, 4, 4, 16, 4) },
+ { 0xa4950, new FormatInfo(Format.Astc5x4Srgb, 5, 4, 16, 4) },
+ { 0xa4941, new FormatInfo(Format.Astc5x5Srgb, 5, 5, 16, 4) },
+ { 0xa4951, new FormatInfo(Format.Astc6x5Srgb, 6, 5, 16, 4) },
+ { 0xa4942, new FormatInfo(Format.Astc6x6Srgb, 6, 6, 16, 4) },
+ { 0xa4955, new FormatInfo(Format.Astc8x5Srgb, 8, 5, 16, 4) },
+ { 0xa4952, new FormatInfo(Format.Astc8x6Srgb, 8, 6, 16, 4) },
+ { 0xa4944, new FormatInfo(Format.Astc8x8Srgb, 8, 8, 16, 4) },
+ { 0xa4956, new FormatInfo(Format.Astc10x5Srgb, 10, 5, 16, 4) },
+ { 0xa4957, new FormatInfo(Format.Astc10x6Srgb, 10, 6, 16, 4) },
+ { 0xa4953, new FormatInfo(Format.Astc10x8Srgb, 10, 8, 16, 4) },
+ { 0xa4945, new FormatInfo(Format.Astc10x10Srgb, 10, 10, 16, 4) },
+ { 0xa4954, new FormatInfo(Format.Astc12x10Srgb, 12, 10, 16, 4) },
+ { 0xa4946, new FormatInfo(Format.Astc12x12Srgb, 12, 12, 16, 4) },
+ { 0x24913, new FormatInfo(Format.A1B5G5R5Unorm, 1, 1, 2, 4) }
};
private static Dictionary<ulong, Format> _attribFormats = new Dictionary<ulong, Format>()