aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
index 24a4d58c..2b65b456 100644
--- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
+++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs
@@ -47,7 +47,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
private uint _vbEnableMask;
private bool _prevDrawIndexed;
- private readonly bool _prevDrawIndirect;
+ private bool _prevDrawIndirect;
+ private bool _prevDrawUsesEngineState;
private IndexType _prevIndexType;
private uint _prevFirstVertex;
private bool _prevTfEnable;
@@ -236,7 +237,9 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
// method when doing indexed draws, so we need to make sure
// to update the vertex buffers if we are doing a regular
// draw after a indexed one and vice-versa.
- if (_drawState.DrawIndexed != _prevDrawIndexed)
+ // Some draws also do not update the engine state, so it is possible for it
+ // to not be dirty even if the vertex counts or other state changed. We need to force it to be dirty in this case.
+ if (_drawState.DrawIndexed != _prevDrawIndexed || _drawState.DrawUsesEngineState != _prevDrawUsesEngineState)
{
_updateTracker.ForceDirty(VertexBufferStateIndex);
@@ -251,6 +254,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
}
_prevDrawIndexed = _drawState.DrawIndexed;
+ _prevDrawUsesEngineState = _drawState.DrawUsesEngineState;
}
// Some draw parameters are used to restrict the vertex buffer size,
@@ -260,6 +264,8 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
if (_drawState.DrawIndirect != _prevDrawIndirect)
{
_updateTracker.ForceDirty(VertexBufferStateIndex);
+
+ _prevDrawIndirect = _drawState.DrawIndirect;
}
// In some cases, the index type is also used to guess the