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
This commit is contained in:
parent
7de7b559ad
commit
2562ca6c3f
8 changed files with 185 additions and 155 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue