diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs | 2 | ||||
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs | 26 |
2 files changed, 18 insertions, 10 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs index c0c2d5b3..b08e7f26 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/StateUpdater.cs @@ -331,7 +331,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed UpdateShaderState(); } - _channel.BufferManager.CommitGraphicsBindings(); + _channel.BufferManager.CommitGraphicsBindings(_drawState.DrawIndexed); } /// <summary> diff --git a/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs index 10224a6d..c656b0f6 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs @@ -515,24 +515,32 @@ namespace Ryujinx.Graphics.Gpu.Memory /// Ensures that the graphics engine bindings are visible to the host GPU. /// Note: this actually performs the binding using the host graphics API. /// </summary> - public void CommitGraphicsBindings() + /// <param name="indexed">True if the index buffer is in use</param> + public void CommitGraphicsBindings(bool indexed) { var bufferCache = _channel.MemoryManager.Physical.BufferCache; - if (_indexBufferDirty || _rebind) + if (indexed) { - _indexBufferDirty = false; - - if (_indexBuffer.Address != 0) + if (_indexBufferDirty || _rebind) { - BufferRange buffer = bufferCache.GetBufferRange(_indexBuffer.Address, _indexBuffer.Size); + _indexBufferDirty = false; + + if (_indexBuffer.Address != 0) + { + BufferRange buffer = bufferCache.GetBufferRange(_indexBuffer.Address, _indexBuffer.Size); - _context.Renderer.Pipeline.SetIndexBuffer(buffer, _indexBuffer.Type); + _context.Renderer.Pipeline.SetIndexBuffer(buffer, _indexBuffer.Type); + } + } + else if (_indexBuffer.Address != 0) + { + bufferCache.SynchronizeBufferRange(_indexBuffer.Address, _indexBuffer.Size); } } - else if (_indexBuffer.Address != 0) + else if (_rebind) { - bufferCache.SynchronizeBufferRange(_indexBuffer.Address, _indexBuffer.Size); + _indexBufferDirty = true; } uint vbEnableMask = _vertexBuffersEnableMask; |