aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/Texture.cs
diff options
context:
space:
mode:
authorgdk <gab.dark.100@gmail.com>2019-11-08 21:55:53 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commitfd196b3d19aa58e830376c93be40575463744aa2 (patch)
treed4e56927ce50dc4e24a6725d1f9caead74c8bea9 /Ryujinx.Graphics.Gpu/Image/Texture.cs
parent769c02235f489f02b1791e6e76dc8b3ab18028ee (diff)
Do not throw for invalid ASTC compressed textures
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/Texture.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs
index cc7e7bf6..28ad3f77 100644
--- a/Ryujinx.Graphics.Gpu/Image/Texture.cs
+++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs
@@ -253,7 +253,7 @@ namespace Ryujinx.Graphics.Gpu.Image
if (!_context.Capabilities.SupportsAstcCompression && _info.FormatInfo.Format.IsAstc())
{
- data = AstcDecoder.DecodeToRgba8(
+ if (!AstcDecoder.TryDecodeToRgba8(
data,
_info.FormatInfo.BlockWidth,
_info.FormatInfo.BlockHeight,
@@ -261,7 +261,13 @@ namespace Ryujinx.Graphics.Gpu.Image
_info.Width,
_info.Height,
_depth,
- _info.Levels);
+ _info.Levels,
+ out Span<byte> decoded))
+ {
+ // TODO: Error.
+ }
+
+ data = decoded;
}
HostTexture.SetData(data);