diff options
Diffstat (limited to 'Ryujinx.Graphics/Gal/OpenGL')
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs | 11 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs | 25 | ||||
| -rw-r--r-- | Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs | 2 |
3 files changed, 37 insertions, 1 deletions
diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs index c2b0c40a..cb2c1a0e 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLEnumConverter.cs @@ -5,6 +5,17 @@ namespace Ryujinx.Graphics.Gal.OpenGL { static class OGLEnumConverter { + public static DepthFunction GetDepthFunc(GalComparisonOp Func) + { + if ((int)Func >= (int)DepthFunction.Never && + (int)Func <= (int)DepthFunction.Always) + { + return (DepthFunction)Func; + } + + throw new ArgumentException(nameof(Func)); + } + public static DrawElementsType GetDrawElementsType(GalIndexFormat Format) { switch (Format) diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs index bdf22b9c..05250696 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLRasterizer.cs @@ -106,6 +106,31 @@ namespace Ryujinx.Graphics.Gal.OpenGL return IboCache.TryGetSize(Key, out long Size) && Size == DataSize; } + public void EnableCullFace() + { + GL.Enable(EnableCap.CullFace); + } + + public void DisableCullFace() + { + GL.Disable(EnableCap.CullFace); + } + + public void EnableDepthTest() + { + GL.Enable(EnableCap.DepthTest); + } + + public void DisableDepthTest() + { + GL.Disable(EnableCap.DepthTest); + } + + public void SetDepthFunction(GalComparisonOp Func) + { + GL.DepthFunc(OGLEnumConverter.GetDepthFunc(Func)); + } + public void CreateVbo(long Key, byte[] Buffer) { int Handle = GL.GenBuffer(); diff --git a/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs b/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs index 28fa8728..da2762d6 100644 --- a/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs +++ b/Ryujinx.Graphics/Gal/OpenGL/OGLShader.cs @@ -283,7 +283,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL return FreeBinding; } - + BindUniformBuffersIfNotNull(Current.Vertex); BindUniformBuffersIfNotNull(Current.TessControl); BindUniformBuffersIfNotNull(Current.TessEvaluation); |
