Fixed undertale bug

This commit is contained in:
Andy Adshead 2019-02-19 14:52:37 +00:00
commit 1284c6b94a
4 changed files with 12 additions and 3 deletions

View file

@ -3,6 +3,7 @@
public interface IGalPipeline public interface IGalPipeline
{ {
void Bind(GalPipelineState State); void Bind(GalPipelineState State);
void Unbind(GalPipelineState State);
void ResetDepthMask(); void ResetDepthMask();
void ResetColorMask(int Index); void ResetColorMask(int Index);

View file

@ -383,6 +383,14 @@ namespace Ryujinx.Graphics.Gal.OpenGL
Old = New; Old = New;
} }
public void Unbind(GalPipelineState State)
{
if (State.ScissorTestCount > 0)
{
GL.Disable(EnableCap.ScissorTest);
}
}
private void SetAllBlendState(BlendState New) private void SetAllBlendState(BlendState New)
{ {
Enable(EnableCap.Blend, New.Enabled); Enable(EnableCap.Blend, New.Enabled);

View file

@ -367,9 +367,6 @@ namespace Ryujinx.Graphics.Gal.OpenGL
GL.Disable(EnableCap.FramebufferSrgb); GL.Disable(EnableCap.FramebufferSrgb);
// Will be re-enabled if needed while binding, called before any game GL calls
GL.Disable(EnableCap.ScissorTest);
GL.BlitFramebuffer( GL.BlitFramebuffer(
SrcX0, SrcX0,
SrcY0, SrcY0,

View file

@ -1074,6 +1074,9 @@ namespace Ryujinx.Graphics.Graphics3d
Gpu.Renderer.Rasterizer.DrawArrays(VertexFirst, VertexCount, PrimType); Gpu.Renderer.Rasterizer.DrawArrays(VertexFirst, VertexCount, PrimType);
} }
// Reset pipeline for host OpenGL calls
Gpu.Renderer.Pipeline.Unbind(State);
//Is the GPU really clearing those registers after draw? //Is the GPU really clearing those registers after draw?
WriteRegister(NvGpuEngine3dReg.IndexBatchFirst, 0); WriteRegister(NvGpuEngine3dReg.IndexBatchFirst, 0);
WriteRegister(NvGpuEngine3dReg.IndexBatchCount, 0); WriteRegister(NvGpuEngine3dReg.IndexBatchCount, 0);