diff options
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Methods.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs index a2c9876e..0b30e61d 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs @@ -117,6 +117,11 @@ namespace Ryujinx.Graphics.Gpu.Engine UpdateRenderTargetState(state, useControl: true); } + if (state.QueryModified(MethodOffset.ScissorState)) + { + UpdateScissorState(state); + } + if (state.QueryModified(MethodOffset.DepthTestEnable, MethodOffset.DepthWriteEnable, MethodOffset.DepthTestFunc)) @@ -322,6 +327,27 @@ namespace Ryujinx.Graphics.Gpu.Engine } /// <summary> + /// Updates host scissor test state based on current GPU state. + /// </summary> + /// <param name="state">Current GPU state</param> + private void UpdateScissorState(GpuState state) + { + for (int index = 0; index < Constants.TotalViewports; index++) + { + ScissorState scissor = state.Get<ScissorState>(MethodOffset.ScissorState, index); + + bool enable = scissor.Enable && (scissor.X1 != 0 || scissor.Y1 != 0 || scissor.X2 != 0xffff || scissor.Y2 != 0xffff); + + _context.Renderer.Pipeline.SetScissorEnable(index, enable); + + if (enable) + { + _context.Renderer.Pipeline.SetScissor(index, scissor.X1, scissor.Y1, scissor.X2 - scissor.X1, scissor.Y2 - scissor.Y1); + } + } + } + + /// <summary> /// Updates host depth test state based on current GPU state. /// </summary> /// <param name="state">Current GPU state</param> |
