0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
ReinUsesLisp cd203e98f2 Implement Geometry shaders (#280)
* Implement Geometry shaders

* Add EmitVertex() and EndPrimitive()

* Read output geometry data from header

* Stub Vmad

* Add Iadd_I32

* Stub Mov_S (S2R)

* Stub Isberd

* Change vertex index to gpr39 in Abuf

* Add stub messages for consistency

* Do not print input block when there is no attributes

* Use GL_ARB_enhanced_layouts

* Skip geometry shaders when there's no GL_ARB_enhanced_layouts

* Address feedback

* Address feedback
2018-07-19 02:33:27 -03:00

43 lines
No EOL
1,003 B
C#

using OpenTK.Graphics.OpenGL;
namespace Ryujinx.Graphics.Gal.OpenGL
{
static class OGLExtension
{
private static bool Initialized = false;
private static bool EnhancedLayouts;
public static bool HasEnhancedLayouts()
{
EnsureInitialized();
return EnhancedLayouts;
}
private static void EnsureInitialized()
{
if (Initialized)
{
return;
}
EnhancedLayouts = HasExtension("GL_ARB_enhanced_layouts");
}
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;
}
}
}