From 4744bde0e59578baeb5f94126087953f6d8ddba0 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 25 Sep 2023 21:00:02 -0300 Subject: Reduce the amount of descriptor pool allocations on Vulkan (#5673) * Reduce the amount of descriptor pool allocations on Vulkan * Formatting * Slice can be simplified * Make GetDescriptorPoolSizes static * Adjust CanFit calculation so that TryAllocateDescriptorSets never fails * Remove unused field --- src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs') diff --git a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs index 17eeef68..4d3b8640 100644 --- a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs +++ b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs @@ -27,6 +27,7 @@ namespace Ryujinx.Graphics.Vulkan { public bool InUse; public bool InConsumption; + public int SubmissionCount; public CommandBuffer CommandBuffer; public FenceHolder Fence; public SemaphoreHolder Semaphore; @@ -193,6 +194,11 @@ namespace Ryujinx.Graphics.Vulkan return _commandBuffers[cbIndex].Fence; } + public int GetSubmissionCount(int cbIndex) + { + return _commandBuffers[cbIndex].SubmissionCount; + } + private int FreeConsumed(bool wait) { int freeEntry = 0; @@ -282,6 +288,7 @@ namespace Ryujinx.Graphics.Vulkan Debug.Assert(entry.CommandBuffer.Handle == cbs.CommandBuffer.Handle); entry.InUse = false; entry.InConsumption = true; + entry.SubmissionCount++; _inUseCount--; var commandBuffer = entry.CommandBuffer; -- cgit v1.2.3