From 468d8f841ffcbebf4130371eb64ab04165bce3e9 Mon Sep 17 00:00:00 2001
From: mageven <62494521+mageven@users.noreply.github.com>
Date: Tue, 7 Apr 2020 14:49:45 +0530
Subject: 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
---
Ryujinx.Graphics.Gpu/Engine/Methods.cs | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'Ryujinx.Graphics.Gpu/Engine/Methods.cs')
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,
@@ -211,6 +216,16 @@ namespace Ryujinx.Graphics.Gpu.Engine
CommitBindings();
}
+ ///
+ /// Updates Rasterizer primitive discard state based on guest gpu state.
+ ///
+ /// Current GPU state
+ private void UpdateRasterizerState(GpuState state)
+ {
+ Boolean32 enable = state.Get(MethodOffset.RasterizeEnable);
+ _context.Renderer.Pipeline.SetRasterizerDiscard(!enable);
+ }
+
///
/// Ensures that the bindings are visible to the host GPU.
/// Note: this actually performs the binding using the host graphics API.
--
cgit v1.2.3