From cb70e7bb30e8ecf5bcdd58b976f2ed5ea8cff947 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 21 Dec 2022 15:08:12 -0300 Subject: Fix DrawArrays vertex buffer size (#4141) --- Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs') diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs index 014a1739..64fa1735 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs @@ -989,6 +989,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed bool drawIndexed = _drawState.DrawIndexed; bool drawIndirect = _drawState.DrawIndirect; + int drawFirstVertex = _drawState.DrawFirstVertex; + int drawVertexCount = _drawState.DrawVertexCount; uint vbEnableMask = 0; for (int index = 0; index < Constants.TotalVertexBuffers; index++) @@ -1050,9 +1052,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed int firstInstance = (int)_state.State.FirstInstance; - var drawState = _state.State.VertexBufferDrawState; - - size = Math.Min(vbSize, (ulong)((firstInstance + drawState.First + drawState.Count) * stride)); + size = Math.Min(vbSize, (ulong)((firstInstance + drawFirstVertex + drawVertexCount) * stride)); } _pipeline.VertexBuffers[index] = new BufferPipelineDescriptor(_channel.MemoryManager.IsMapped(address), stride, divisor); -- cgit v1.2.3