2018-07-19 06:33:27 +01:00
|
|
|
|
using OpenTK.Graphics.OpenGL;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
|
|
{
|
|
|
|
|
static class OGLExtension
|
|
|
|
|
{
|
|
|
|
|
private static bool Initialized = false;
|
|
|
|
|
|
|
|
|
|
private static bool EnhancedLayouts;
|
|
|
|
|
|
2018-08-25 20:39:08 +01:00
|
|
|
|
private static bool TextureMirrorClamp;
|
|
|
|
|
|
2018-07-19 06:33:27 +01:00
|
|
|
|
public static bool HasEnhancedLayouts()
|
|
|
|
|
{
|
|
|
|
|
EnsureInitialized();
|
|
|
|
|
|
|
|
|
|
return EnhancedLayouts;
|
|
|
|
|
}
|
|
|
|
|
|
2018-08-25 20:39:08 +01:00
|
|
|
|
public static bool HasTextureMirrorClamp()
|
|
|
|
|
{
|
|
|
|
|
EnsureInitialized();
|
|
|
|
|
|
|
|
|
|
return TextureMirrorClamp;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-19 06:33:27 +01:00
|
|
|
|
private static void EnsureInitialized()
|
|
|
|
|
{
|
|
|
|
|
if (Initialized)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EnhancedLayouts = HasExtension("GL_ARB_enhanced_layouts");
|
2018-08-25 20:39:08 +01:00
|
|
|
|
|
|
|
|
|
TextureMirrorClamp = HasExtension("GL_EXT_texture_mirror_clamp");
|
2018-07-19 06:33:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|