aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2018-09-25 19:55:30 -0300
committerAc_K <Acoustik666@gmail.com>2018-09-26 00:55:30 +0200
commit2562ca6c3fe6ef328e0926c9cbcd6bb52abb328f (patch)
treed4719ba44b7094cf4e8cf11db858b323644fd44a /Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
parent7de7b559adc1924d3ff31cc58b281f70e468155f (diff)
Fix multiple rendertargets (#427)
* Simplify render target bindings * Implement multiple viewports * Pack glViewportIndexed calls into a single glViewportArray * Use ARB_viewport_array when available * Cache framebuffer attachments * Use get accessors in OGLExtension * Address feedback
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs')
-rw-r--r--Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs37
1 files changed, 7 insertions, 30 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
index 5ad42298..11daeb59 100644
--- a/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
+++ b/Ryujinx.Graphics/Gal/OpenGL/OGLExtension.cs
@@ -1,40 +1,17 @@
using OpenTK.Graphics.OpenGL;
+using System;
namespace Ryujinx.Graphics.Gal.OpenGL
{
static class OGLExtension
{
- private static bool Initialized = false;
+ 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 bool EnhancedLayouts;
-
- private static bool TextureMirrorClamp;
-
- public static bool HasEnhancedLayouts()
- {
- EnsureInitialized();
-
- return EnhancedLayouts;
- }
-
- public static bool HasTextureMirrorClamp()
- {
- EnsureInitialized();
-
- return TextureMirrorClamp;
- }
-
- private static void EnsureInitialized()
- {
- if (Initialized)
- {
- return;
- }
-
- EnhancedLayouts = HasExtension("GL_ARB_enhanced_layouts");
-
- TextureMirrorClamp = HasExtension("GL_EXT_texture_mirror_clamp");
- }
+ public static bool EnhancedLayouts => s_EnhancedLayouts.Value;
+ public static bool TextureMirrorClamp => s_TextureMirrorClamp.Value;
+ public static bool ViewportArray => s_ViewportArray.Value;
private static bool HasExtension(string Name)
{