diff options
author | mageven <62494521+mageven@users.noreply.github.com> | 2020-04-07 14:49:45 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 19:19:45 +1000 |
commit | 468d8f841ffcbebf4130371eb64ab04165bce3e9 (patch) | |
tree | cc3dd0cf370f7ae3d80720a4324baf954560a8d4 /Ryujinx.Graphics.Gpu/Engine/Methods.cs | |
parent | e99e6d0ad1fb0e0245469a67526de2dc03bc0658 (diff) |
Simple GPU fixes (#1093)
* Implement RasterizeEnable
* Match viewport count to hardware
* Simplify ScissorTest tracking around Blits
* Disable RasterizerDiscard around Blits and track its state
* Read RasterizeEnable reg as bool and add doc
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
-rw-r--r-- | Ryujinx.Graphics.Gpu/Engine/Methods.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Engine/Methods.cs b/Ryujinx.Graphics.Gpu/Engine/Methods.cs index 18720440..50913801 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Methods.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Methods.cs @@ -108,6 +108,11 @@ namespace Ryujinx.Graphics.Gpu.Engine UpdateShaderState(state); } + if (state.QueryModified(MethodOffset.RasterizeEnable)) + { + UpdateRasterizerState(state); + } + if (state.QueryModified(MethodOffset.RtColorState, MethodOffset.RtDepthStencilState, MethodOffset.RtControl, @@ -212,6 +217,16 @@ namespace Ryujinx.Graphics.Gpu.Engine } /// <summary> + /// Updates Rasterizer primitive discard state based on guest gpu state. + /// </summary> + /// <param name="state">Current GPU state</param> + private void UpdateRasterizerState(GpuState state) + { + Boolean32 enable = state.Get<Boolean32>(MethodOffset.RasterizeEnable); + _context.Renderer.Pipeline.SetRasterizerDiscard(!enable); + } + + /// <summary> /// Ensures that the bindings are visible to the host GPU. /// Note: this actually performs the binding using the host graphics API. /// </summary> |