diff options
| author | Alex Barney <thealexbarney@gmail.com> | 2019-03-03 19:45:25 -0600 |
|---|---|---|
| committer | jduncanator <1518948+jduncanator@users.noreply.github.com> | 2019-03-04 12:45:25 +1100 |
| commit | 1f554c1093dde6a4d3ed80fae2675abfb6c12fac (patch) | |
| tree | bbbdfb87999168288777ac404081f3e49c7440ae /Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs | |
| parent | 8e71ea0812f6b56ff819dbda951b463bcb5eb8dc (diff) | |
Do naming refactoring on Ryujinx.Graphics (#611)
* Renaming part 1
* Renaming part 2
* Renaming part 3
* Renaming part 4
* Renaming part 5
* Renaming part 6
* Renaming part 7
* Renaming part 8
* Renaming part 9
* Renaming part 10
* General cleanup
* Thought I got all of these
* Apply #595
* Additional renaming
* Tweaks from feedback
* Rename files
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs deleted file mode 100644 index eb06f83c..00000000 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs +++ /dev/null @@ -1,70 +0,0 @@ -using OpenTK.Graphics.OpenGL; -using Ryujinx.Common.Logging; -using System; - -namespace Ryujinx.Graphics.Gal.OpenGL -{ - static class OGLExtension - { - // Private lazy backing variables - private static Lazy<bool> s_EnhancedLayouts = new Lazy<bool>(() => HasExtension("GL_ARB_enhanced_layouts")); - private static Lazy<bool> s_TextureMirrorClamp = new Lazy<bool>(() => HasExtension("GL_EXT_texture_mirror_clamp")); - private static Lazy<bool> s_ViewportArray = new Lazy<bool>(() => HasExtension("GL_ARB_viewport_array")); - - private static Lazy<bool> s_NvidiaDriver = new Lazy<bool>(() => IsNvidiaDriver()); - - // Public accessors - public static bool EnhancedLayouts => s_EnhancedLayouts.Value; - public static bool TextureMirrorClamp => s_TextureMirrorClamp.Value; - public static bool ViewportArray => s_ViewportArray.Value; - - public static bool NvidiaDrvier => s_NvidiaDriver.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; - } - } - - Logger.PrintInfo(LogClass.Gpu, $"OpenGL extension {Name} unavailable. You may experience some performance degredation"); - - return false; - } - - private static bool IsNvidiaDriver() - { - return GL.GetString(StringName.Vendor).Equals("NVIDIA Corporation"); - } - - public static class Required - { - // Public accessors - public static bool EnhancedLayouts => s_EnhancedLayoutsRequired.Value; - public static bool TextureMirrorClamp => s_TextureMirrorClampRequired.Value; - public static bool ViewportArray => s_ViewportArrayRequired.Value; - - // Private lazy backing variables - private static Lazy<bool> s_EnhancedLayoutsRequired = new Lazy<bool>(() => HasExtensionRequired(OGLExtension.EnhancedLayouts, "GL_ARB_enhanced_layouts")); - private static Lazy<bool> s_TextureMirrorClampRequired = new Lazy<bool>(() => HasExtensionRequired(OGLExtension.TextureMirrorClamp, "GL_EXT_texture_mirror_clamp")); - private static Lazy<bool> s_ViewportArrayRequired = new Lazy<bool>(() => HasExtensionRequired(OGLExtension.ViewportArray, "GL_ARB_viewport_array")); - - private static bool HasExtensionRequired(bool Value, string Name) - { - if (Value) - { - return true; - } - - Logger.PrintWarning(LogClass.Gpu, $"Required OpenGL extension {Name} unavailable. You may experience some rendering issues"); - - return false; - } - } - } -} |
