Avoid some redundant GL calls (#1958)

This commit is contained in:
gdkchan 2021-01-26 18:44:07 -03:00 committed by GitHub
parent d6bd0470fb
commit caf049ed15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 115 additions and 51 deletions

View file

@ -436,8 +436,6 @@ namespace Ryujinx.Graphics.Gpu.Engine
bool enable = scissor.Enable && (scissor.X1 != 0 || scissor.Y1 != 0 || scissor.X2 != 0xffff || scissor.Y2 != 0xffff);
_context.Renderer.Pipeline.SetScissorEnable(index, enable);
if (enable)
{
int x = scissor.X1;
@ -454,7 +452,11 @@ namespace Ryujinx.Graphics.Gpu.Engine
height = (int)Math.Ceiling(height * scale);
}
_context.Renderer.Pipeline.SetScissor(index, x, y, width, height);
_context.Renderer.Pipeline.SetScissor(index, true, x, y, width, height);
}
else
{
_context.Renderer.Pipeline.SetScissor(index, false, 0, 0, 0, 0);
}
}
}