From 1876b346fea647e8284a66bb6d62c38801035cff Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 13 Oct 2019 03:02:07 -0300 Subject: Initial work --- Ryujinx.Graphics.OpenGL/HwCapabilities.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Ryujinx.Graphics.OpenGL/HwCapabilities.cs (limited to 'Ryujinx.Graphics.OpenGL/HwCapabilities.cs') diff --git a/Ryujinx.Graphics.OpenGL/HwCapabilities.cs b/Ryujinx.Graphics.OpenGL/HwCapabilities.cs new file mode 100644 index 00000000..f958946e --- /dev/null +++ b/Ryujinx.Graphics.OpenGL/HwCapabilities.cs @@ -0,0 +1,27 @@ +using OpenTK.Graphics.OpenGL; +using System; + +namespace Ryujinx.Graphics.OpenGL +{ + static class HwCapabilities + { + private static Lazy _astcCompression = new Lazy(() => HasExtension("GL_KHR_texture_compression_astc_ldr")); + + public static bool SupportsAstcCompression => _astcCompression.Value; + + private static bool HasExtension(string name) + { + int numExtensions = GL.GetInteger(GetPName.NumExtensions); + + for (int extension = 0; extension < numExtensions; extension++) + { + if (GL.GetString(StringNameIndexed.Extensions, extension) == name) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file -- cgit v1.2.3