Texture.ConvertToHostCompatibleFormat(): dispose of result in Astc decode branch

This commit is contained in:
jhorv 2024-04-09 20:12:14 -04:00
commit 1928beff73

View file

@ -793,6 +793,8 @@ namespace Ryujinx.Graphics.Gpu.Image
// - ASTC is usually not supported on desktop cards. // - ASTC is usually not supported on desktop cards.
// - BC4/BC5 is not supported on 3D textures. // - BC4/BC5 is not supported on 3D textures.
if (!_context.Capabilities.SupportsAstcCompression && Format.IsAstc()) if (!_context.Capabilities.SupportsAstcCompression && Format.IsAstc())
{
using (result)
{ {
if (!AstcDecoder.TryDecodeToRgba8P( if (!AstcDecoder.TryDecodeToRgba8P(
result.Memory, result.Memory,
@ -820,6 +822,7 @@ namespace Ryujinx.Graphics.Gpu.Image
return decoded; return decoded;
} }
}
else if (!_context.Capabilities.SupportsEtc2Compression && Format.IsEtc2()) else if (!_context.Capabilities.SupportsEtc2Compression && Format.IsEtc2())
{ {
switch (Format) switch (Format)