diff options
author | gdkchan <gab.dark.100@gmail.com> | 2022-12-21 20:39:58 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-21 20:39:58 -0300 |
commit | f906eb06c28880c20160cb4a969e3f6fddb3029b (patch) | |
tree | 50b716246caeda439272b3d929bbeab1bfcf87c7 /Ryujinx.Graphics.GAL/Format.cs | |
parent | 219f63ff4ebb739f349ca3ddd6c11e5068bcf0f1 (diff) |
Implement a software ETC2 texture decoder (#4121)1.1.488
* Implement a software ETC2 texture decoder
* Fix output size calculation for non-2D textures
* Address PR feedback
Diffstat (limited to 'Ryujinx.Graphics.GAL/Format.cs')
-rw-r--r-- | Ryujinx.Graphics.GAL/Format.cs | 21 |
1 files changed, 21 insertions, 0 deletions
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 @@ -517,6 +517,27 @@ namespace Ryujinx.Graphics.GAL } /// <summary> + /// Checks if the texture format is an ETC2 format. + /// </summary> + /// <param name="format">Texture format</param> + /// <returns>True if the texture format is an ETC2 format, false otherwise</returns> + 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; + } + + /// <summary> /// Checks if the texture format is a BGR format. /// </summary> /// <param name="format">Texture format</param> |