From fd196b3d19aa58e830376c93be40575463744aa2 Mon Sep 17 00:00:00 2001 From: gdk Date: Fri, 8 Nov 2019 21:55:53 -0300 Subject: Do not throw for invalid ASTC compressed textures --- Ryujinx.Graphics.Gpu/Image/Texture.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image') 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 decoded)) + { + // TODO: Error. + } + + data = decoded; } HostTexture.SetData(data); -- cgit v1.2.3