aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/VertexBufferState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/VertexBufferState.cs')
-rw-r--r--Ryujinx.Graphics.Vulkan/VertexBufferState.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Vulkan/VertexBufferState.cs b/Ryujinx.Graphics.Vulkan/VertexBufferState.cs
index 7a022010..c4856019 100644
--- a/Ryujinx.Graphics.Vulkan/VertexBufferState.cs
+++ b/Ryujinx.Graphics.Vulkan/VertexBufferState.cs
@@ -129,6 +129,17 @@ namespace Ryujinx.Graphics.Vulkan
return _buffer == buffer;
}
+ public void Swap(Auto<DisposableBuffer> from, Auto<DisposableBuffer> to)
+ {
+ if (_buffer == from)
+ {
+ _buffer.DecrementReferenceCount();
+ to.IncrementReferenceCount();
+
+ _buffer = to;
+ }
+ }
+
public void Dispose()
{
// Only dispose if this buffer is not refetched on each bind.