From 7c39c731e24b110611d7c3c3f916f26950b4d501 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 9 Dec 2018 16:29:11 -0300 Subject: [PATCH] Fix a few small regressions (color mask not being set, primitive restart not being enabled, and vertex buffer size being calculated improperly when vertex base is non-zero) --- Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs b/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs index 0067098d92..7d4c174237 100644 --- a/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs +++ b/Ryujinx.Graphics/Graphics3d/NvGpuEngine3d.cs @@ -120,6 +120,8 @@ namespace Ryujinx.Graphics.Graphics3d //Ensure that all components are enabled by default. //FIXME: Is this correct? + WriteRegister(NvGpuEngine3dReg.ColorMaskN, 0x1111); + Gpu.Renderer.RenderTarget.FramebufferSrgb = true; for (int Index = 0; Index < RenderTargetsCount; Index++) @@ -622,6 +624,8 @@ namespace Ryujinx.Graphics.Graphics3d { bool PrimitiveRestartEnabled = ReadRegisterBool(NvGpuEngine3dReg.PrimRestartEnable); + Gpu.Renderer.Pipeline.SetPrimitiveRestartEnabled(PrimitiveRestartEnabled); + if (PrimitiveRestartEnabled) { int Index = ReadRegister(NvGpuEngine3dReg.PrimRestartIndex); @@ -800,6 +804,7 @@ namespace Ryujinx.Graphics.Graphics3d int IndexEntryFmt = ReadRegister(NvGpuEngine3dReg.IndexArrayFormat); int IndexFirst = ReadRegister(NvGpuEngine3dReg.IndexBatchFirst); int IndexCount = ReadRegister(NvGpuEngine3dReg.IndexBatchCount); + int VertexBase = ReadRegister(NvGpuEngine3dReg.VertexArrayElemBase); int PrimCtrl = ReadRegister(NvGpuEngine3dReg.VertexBeginGl); GalPrimitiveType PrimType = (GalPrimitiveType)(PrimCtrl & 0xffff); @@ -975,7 +980,9 @@ namespace Ryujinx.Graphics.Graphics3d long VbSize = (VbEndPos - VbPosition) + 1; - long MaxVbSize = (IndexCount != 0 ? IbVtxCount : VertexFirst + VertexCount) * Stride; + long MaxVbSize = (IndexCount != 0 + ? VertexBase + IbVtxCount + : VertexFirst + VertexCount) * Stride; if (MaxVbSize < VbSize) {