From 464a92d8a7082a86552d8776256fa763ded227f4 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 12 Oct 2021 18:46:42 -0300 Subject: [PATCH] Force index buffer update for games using Vulkan (#2726) --- Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs | 1 + Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClass.cs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs index 82aff2049..a060c6c96 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs @@ -312,6 +312,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed bool oldDrawIndexed = _drawState.DrawIndexed; _drawState.DrawIndexed = true; + engine.ForceStateDirty(IndexBufferCountMethodOffset * 4); DrawEnd(engine, firstIndex, indexCount); diff --git a/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClass.cs b/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClass.cs index 52637c20f..5478704ac 100644 --- a/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClass.cs +++ b/Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClass.cs @@ -143,6 +143,15 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed _stateUpdater.SetAllDirty(); } + /// + /// Marks the specified register offset as dirty, forcing the associated state to update on the next draw. + /// + /// Register offset + public void ForceStateDirty(int offset) + { + _stateUpdater.SetDirty(offset); + } + /// /// Forces the shaders to be rebound on the next draw. ///