From 11a7c99764ed4e6c575c877c69ca627645702a42 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 1 Nov 2020 15:32:53 -0300 Subject: Support 3D BC4 and BC5 compressed textures (#1655) * Support 3D BC4 and BC5 compressed textures * PR feedback * Fix some typos --- Ryujinx.Graphics.GAL/Format.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Ryujinx.Graphics.GAL/Format.cs') 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(); } + + /// + /// Checks if the texture format is a BC4 compressed format. + /// + /// Texture format + /// True if the texture format is a BC4 compressed format, false otherwise + public static bool IsBc4(this Format format) + { + return format == Format.Bc4Unorm || format == Format.Bc4Snorm; + } + + /// + /// Checks if the texture format is a BC5 compressed format. + /// + /// Texture format + /// True if the texture format is a BC5 compressed format, false otherwise + public static bool IsBc5(this Format format) + { + return format == Format.Bc5Unorm || format == Format.Bc5Snorm; + } } } \ No newline at end of file -- cgit v1.2.3