aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.GAL/Format.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-11-01 15:32:53 -0300
committerGitHub <noreply@github.com>2020-11-01 15:32:53 -0300
commit11a7c99764ed4e6c575c877c69ca627645702a42 (patch)
tree27f085e7242dd417dbe691a7a4f13d42f76cf58b /Ryujinx.Graphics.GAL/Format.cs
parent6222f173f0c85a55d31655ddb78638907c07e1ce (diff)
Support 3D BC4 and BC5 compressed textures (#1655)
* Support 3D BC4 and BC5 compressed textures * PR feedback * Fix some typos
Diffstat (limited to 'Ryujinx.Graphics.GAL/Format.cs')
-rw-r--r--Ryujinx.Graphics.GAL/Format.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.GAL/Format.cs b/Ryujinx.Graphics.GAL/Format.cs
index a4e434b1..10b754ea 100644
--- a/Ryujinx.Graphics.GAL/Format.cs
+++ b/Ryujinx.Graphics.GAL/Format.cs
@@ -341,5 +341,25 @@ namespace Ryujinx.Graphics.GAL
{
return format.IsUint() || format.IsSint();
}
+
+ /// <summary>
+ /// Checks if the texture format is a BC4 compressed format.
+ /// </summary>
+ /// <param name="format">Texture format</param>
+ /// <returns>True if the texture format is a BC4 compressed format, false otherwise</returns>
+ public static bool IsBc4(this Format format)
+ {
+ return format == Format.Bc4Unorm || format == Format.Bc4Snorm;
+ }
+
+ /// <summary>
+ /// Checks if the texture format is a BC5 compressed format.
+ /// </summary>
+ /// <param name="format">Texture format</param>
+ /// <returns>True if the texture format is a BC5 compressed format, false otherwise</returns>
+ public static bool IsBc5(this Format format)
+ {
+ return format == Format.Bc5Unorm || format == Format.Bc5Snorm;
+ }
}
} \ No newline at end of file