mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-24 16:30:12 +01:00
Fix draw indexed flag not being cleared for instanced draws, also avoid state updates in the middle of a indexed draw
This commit is contained in:
parent
23b8a86d35
commit
375ee0ba96
@ -26,29 +26,35 @@ namespace Ryujinx.Graphics.Gpu.Engine
|
|||||||
|
|
||||||
private void DrawEnd(GpuState state, int argument)
|
private void DrawEnd(GpuState state, int argument)
|
||||||
{
|
{
|
||||||
|
if (_instancedDrawPending)
|
||||||
|
{
|
||||||
|
_drawIndexed = false;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
UpdateState(state);
|
UpdateState(state);
|
||||||
|
|
||||||
bool instanced = _vsUsesInstanceId || _isAnyVbInstanced;
|
bool instanced = _vsUsesInstanceId || _isAnyVbInstanced;
|
||||||
|
|
||||||
if (instanced)
|
if (instanced)
|
||||||
{
|
{
|
||||||
if (!_instancedDrawPending)
|
_instancedDrawPending = true;
|
||||||
{
|
|
||||||
_instancedDrawPending = true;
|
|
||||||
|
|
||||||
_instancedIndexed = _drawIndexed;
|
_instancedIndexed = _drawIndexed;
|
||||||
|
|
||||||
_instancedFirstIndex = _firstIndex;
|
_instancedFirstIndex = _firstIndex;
|
||||||
_instancedFirstVertex = state.Get<int>(MethodOffset.FirstVertex);
|
_instancedFirstVertex = state.Get<int>(MethodOffset.FirstVertex);
|
||||||
_instancedFirstInstance = state.Get<int>(MethodOffset.FirstInstance);
|
_instancedFirstInstance = state.Get<int>(MethodOffset.FirstInstance);
|
||||||
|
|
||||||
_instancedIndexCount = _indexCount;
|
_instancedIndexCount = _indexCount;
|
||||||
|
|
||||||
var drawState = state.Get<VertexBufferDrawState>(MethodOffset.VertexBufferDrawState);
|
var drawState = state.Get<VertexBufferDrawState>(MethodOffset.VertexBufferDrawState);
|
||||||
|
|
||||||
_instancedDrawStateFirst = drawState.First;
|
_instancedDrawStateFirst = drawState.First;
|
||||||
_instancedDrawStateCount = drawState.Count;
|
_instancedDrawStateCount = drawState.Count;
|
||||||
}
|
|
||||||
|
_drawIndexed = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user