aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/Texture.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-12-30 13:10:54 -0300
committerGitHub <noreply@github.com>2021-12-30 17:10:54 +0100
commitc05c8e09d48eb36beef02fda885ec0fd36135463 (patch)
tree7a83c260c275e9d445e0c2561c2894158b8620a5 /Ryujinx.Graphics.Gpu/Image/Texture.cs
parent1485780d90a554a9a71585ff1dd6e049b32b761e (diff)
Add support for the R4G4 texture format (#2956)
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/Texture.cs10
1 files changed, 7 insertions, 3 deletions
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);
}