diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/FormatTable.cs | 1 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/Texture.cs | 10 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs | 5 |
3 files changed, 13 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/FormatTable.cs b/Ryujinx.Graphics.Gpu/Image/FormatTable.cs index 03687ade..3c97e2e2 100644 --- a/Ryujinx.Graphics.Gpu/Image/FormatTable.cs +++ b/Ryujinx.Graphics.Gpu/Image/FormatTable.cs @@ -58,6 +58,7 @@ namespace Ryujinx.Graphics.Gpu.Image { 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) }, + { 0x2491e, new FormatInfo(Format.R4G4Unorm, 1, 1, 1, 2) }, { 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) }, diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs index 590356e3..6d981479 100644 --- a/Ryujinx.Graphics.Gpu/Image/Texture.cs +++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs @@ -785,7 +785,7 @@ namespace Ryujinx.Graphics.Gpu.Image // Handle compressed cases not supported by the host: // - ASTC is usually not supported on desktop cards. // - BC4/BC5 is not supported on 3D textures. - if (!_context.Capabilities.SupportsAstcCompression && Info.FormatInfo.Format.IsAstc()) + if (!_context.Capabilities.SupportsAstcCompression && Format.IsAstc()) { if (!AstcDecoder.TryDecodeToRgba8P( data.ToArray(), @@ -805,11 +805,15 @@ namespace Ryujinx.Graphics.Gpu.Image data = decoded; } - else if (Target == Target.Texture3D && Info.FormatInfo.Format.IsBc4()) + else if (!_context.Capabilities.SupportsR4G4Format && Format == Format.R4G4Unorm) + { + data = PixelConverter.ConvertR4G4ToR4G4B4A4(data); + } + else if (Target == Target.Texture3D && Format.IsBc4()) { data = BCnDecoder.DecodeBC4(data, width, height, depth, levels, layers, Info.FormatInfo.Format == Format.Bc4Snorm); } - else if (Target == Target.Texture3D && Info.FormatInfo.Format.IsBc5()) + else if (Target == Target.Texture3D && Format.IsBc5()) { data = BCnDecoder.DecodeBC5(data, width, height, depth, levels, layers, Info.FormatInfo.Format == Format.Bc5Snorm); } diff --git a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs index c70b2971..ce9fd75c 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureCompatibility.cs @@ -66,6 +66,11 @@ namespace Ryujinx.Graphics.Gpu.Image } } + if (!caps.SupportsR4G4Format && info.FormatInfo.Format == Format.R4G4Unorm) + { + return new FormatInfo(Format.R4G4B4A4Unorm, 1, 1, 2, 4); + } + if (info.Target == Target.Texture3D) { // The host API does not support 3D BC4/BC5 compressed formats. |
