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/State/GpuState.cs | 3 +++ Ryujinx.Graphics.Gpu/State/GpuStateTable.cs | 6 +++--- Ryujinx.Graphics.Gpu/State/MethodOffset.cs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/State') diff --git a/Ryujinx.Graphics.Gpu/State/GpuState.cs b/Ryujinx.Graphics.Gpu/State/GpuState.cs index de09f3e7..4b81029c 100644 --- a/Ryujinx.Graphics.Gpu/State/GpuState.cs +++ b/Ryujinx.Graphics.Gpu/State/GpuState.cs @@ -117,6 +117,9 @@ namespace Ryujinx.Graphics.Gpu.State /// private void InitializeDefaultState() { + // Enable Rasterizer + _backingMemory[(int)MethodOffset.RasterizeEnable] = 1; + // Depth ranges. for (int index = 0; index < 8; index++) { diff --git a/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs b/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs index 8631efcc..e59a3aaf 100644 --- a/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs +++ b/Ryujinx.Graphics.Gpu/State/GpuStateTable.cs @@ -53,11 +53,11 @@ namespace Ryujinx.Graphics.Gpu.State public static TableItem[] Table = new TableItem[] { new TableItem(MethodOffset.RtColorState, typeof(RtColorState), 8), - new TableItem(MethodOffset.ViewportTransform, typeof(ViewportTransform), 8), - new TableItem(MethodOffset.ViewportExtents, typeof(ViewportExtents), 8), + new TableItem(MethodOffset.ViewportTransform, typeof(ViewportTransform), Constants.TotalViewports), + new TableItem(MethodOffset.ViewportExtents, typeof(ViewportExtents), Constants.TotalViewports), new TableItem(MethodOffset.VertexBufferDrawState, typeof(VertexBufferDrawState), 1), new TableItem(MethodOffset.DepthBiasState, typeof(DepthBiasState), 1), - new TableItem(MethodOffset.ScissorState, typeof(ScissorState), 8), + new TableItem(MethodOffset.ScissorState, typeof(ScissorState), Constants.TotalViewports), new TableItem(MethodOffset.StencilBackMasks, typeof(StencilBackMasks), 1), new TableItem(MethodOffset.RtDepthStencilState, typeof(RtDepthStencilState), 1), new TableItem(MethodOffset.VertexAttribState, typeof(VertexAttribState), 16), diff --git a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs index 0a720b2c..a178c2f8 100644 --- a/Ryujinx.Graphics.Gpu/State/MethodOffset.cs +++ b/Ryujinx.Graphics.Gpu/State/MethodOffset.cs @@ -16,6 +16,7 @@ namespace Ryujinx.Graphics.Gpu.State DispatchParamsAddress = 0xad, Dispatch = 0xaf, CopyBuffer = 0xc0, + RasterizeEnable = 0xdf, CopyBufferParams = 0x100, CopyBufferSwizzle = 0x1c2, CopyBufferDstTexture = 0x1c3, -- cgit v1.2.3