Implement alpha test using legacy functions (#1426)

This commit is contained in:
gdkchan 2020-07-28 18:30:08 -03:00 committed by GitHub
parent 938c06c652
commit 43c13057da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 13 deletions

View file

@ -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;
}