aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.OpenGL/Pipeline.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-07-28 18:30:08 -0300
committerGitHub <noreply@github.com>2020-07-28 18:30:08 -0300
commit43c13057da7726c324f2b5d674e5e1308eb1f6a7 (patch)
tree222d8bace4d35166aa9a0ca8d6ed121bec20b287 /Ryujinx.Graphics.OpenGL/Pipeline.cs
parent938c06c652ca15e4a5f776e434fa8304b4b43f0b (diff)
Implement alpha test using legacy functions (#1426)
Diffstat (limited to 'Ryujinx.Graphics.OpenGL/Pipeline.cs')
-rw-r--r--Ryujinx.Graphics.OpenGL/Pipeline.cs20
1 files changed, 12 insertions, 8 deletions
diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs
index 4f3c2a29..69bd7844 100644
--- a/Ryujinx.Graphics.OpenGL/Pipeline.cs
+++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs
@@ -157,7 +157,6 @@ namespace Ryujinx.Graphics.OpenGL
if (!_program.IsLinked)
{
Logger.PrintDebug(LogClass.Gpu, "Dispatch error, shader not linked.");
-
return;
}
@@ -171,7 +170,6 @@ namespace Ryujinx.Graphics.OpenGL
if (!_program.IsLinked)
{
Logger.PrintDebug(LogClass.Gpu, "Draw error, shader not linked.");
-
return;
}
@@ -290,7 +288,6 @@ namespace Ryujinx.Graphics.OpenGL
if (!_program.IsLinked)
{
Logger.PrintDebug(LogClass.Gpu, "Draw error, shader not linked.");
-
return;
}
@@ -527,12 +524,23 @@ namespace Ryujinx.Graphics.OpenGL
_tfEnabled = false;
}
+ public void SetAlphaTest(bool enable, float reference, CompareOp op)
+ {
+ if (!enable)
+ {
+ GL.Disable(EnableCap.AlphaTest);
+ return;
+ }
+
+ GL.AlphaFunc((AlphaFunction)op.Convert(), reference);
+ GL.Enable(EnableCap.AlphaTest);
+ }
+
public void SetBlendState(int index, BlendDescriptor blend)
{
if (!blend.Enable)
{
GL.Disable(IndexedEnableCap.Blend, index);
-
return;
}
@@ -658,7 +666,6 @@ namespace Ryujinx.Graphics.OpenGL
if (!enable)
{
GL.Disable(EnableCap.CullFace);
-
return;
}
@@ -742,7 +749,6 @@ namespace Ryujinx.Graphics.OpenGL
if (!enable)
{
GL.Disable(EnableCap.PrimitiveRestart);
-
return;
}
@@ -874,7 +880,6 @@ namespace Ryujinx.Graphics.OpenGL
if (!stencilTest.TestEnable)
{
GL.Disable(EnableCap.StencilTest);
-
return;
}
@@ -1077,7 +1082,6 @@ namespace Ryujinx.Graphics.OpenGL
if (buffer.Handle == null)
{
GL.BindBufferRange(target, bindingPoint, 0, IntPtr.Zero, 0);
-
return;
}