Explorar el Código

Force index buffer update for games using Vulkan (#2726)

gdkchan hace 4 años
padre
commit
464a92d8a7

+ 1 - 0
Ryujinx.Graphics.Gpu/Engine/Threed/DrawManager.cs

@@ -312,6 +312,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
             bool oldDrawIndexed = _drawState.DrawIndexed;
             bool oldDrawIndexed = _drawState.DrawIndexed;
 
 
             _drawState.DrawIndexed = true;
             _drawState.DrawIndexed = true;
+            engine.ForceStateDirty(IndexBufferCountMethodOffset * 4);
 
 
             DrawEnd(engine, firstIndex, indexCount);
             DrawEnd(engine, firstIndex, indexCount);
 
 

+ 9 - 0
Ryujinx.Graphics.Gpu/Engine/Threed/ThreedClass.cs

@@ -143,6 +143,15 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
             _stateUpdater.SetAllDirty();
             _stateUpdater.SetAllDirty();
         }
         }
 
 
+        /// <summary>
+        /// Marks the specified register offset as dirty, forcing the associated state to update on the next draw.
+        /// </summary>
+        /// <param name="offset">Register offset</param>
+        public void ForceStateDirty(int offset)
+        {
+            _stateUpdater.SetDirty(offset);
+        }
+
         /// <summary>
         /// <summary>
         /// Forces the shaders to be rebound on the next draw.
         /// Forces the shaders to be rebound on the next draw.
         /// </summary>
         /// </summary>