From f906eb06c28880c20160cb4a969e3f6fddb3029b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 21 Dec 2022 20:39:58 -0300 Subject: Implement a software ETC2 texture decoder (#4121) * Implement a software ETC2 texture decoder * Fix output size calculation for non-2D textures * Address PR feedback --- Ryujinx.Graphics.GAL/Format.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Ryujinx.Graphics.GAL/Format.cs') diff --git a/Ryujinx.Graphics.GAL/Format.cs b/Ryujinx.Graphics.GAL/Format.cs index 8a50f22d..87d08803 100644 --- a/Ryujinx.Graphics.GAL/Format.cs +++ b/Ryujinx.Graphics.GAL/Format.cs @@ -516,6 +516,27 @@ namespace Ryujinx.Graphics.GAL return false; } + /// + /// Checks if the texture format is an ETC2 format. + /// + /// Texture format + /// True if the texture format is an ETC2 format, false otherwise + public static bool IsEtc2(this Format format) + { + switch (format) + { + case Format.Etc2RgbaSrgb: + case Format.Etc2RgbaUnorm: + case Format.Etc2RgbPtaSrgb: + case Format.Etc2RgbPtaUnorm: + case Format.Etc2RgbSrgb: + case Format.Etc2RgbUnorm: + return true; + } + + return false; + } + /// /// Checks if the texture format is a BGR format. /// -- cgit v1.2.3