From 3b9bf0666f9c05e50a2d2b2160fe1308eee0e4f8 Mon Sep 17 00:00:00 2001 From: gdk Date: Tue, 21 Jun 2022 23:10:16 -0300 Subject: [PATCH] Increase light command buffer pool to 2 command buffers, throw rather than returning invalid cbs --- Ryujinx.Graphics.Vulkan/CommandBufferPool.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs b/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs index 33f4c3ff1..47337b666 100644 --- a/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs +++ b/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs @@ -77,7 +77,8 @@ namespace Ryujinx.Graphics.Vulkan api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError(); - _totalCommandBuffers = isLight ? 1 : MaxCommandBuffers; + // We need at least 2 command buffers to get texture data in some cases. + _totalCommandBuffers = isLight ? 2 : MaxCommandBuffers; _totalCommandBuffersMask = _totalCommandBuffers - 1; _commandBuffers = new ReservedCommandBuffer[_totalCommandBuffers]; @@ -236,9 +237,9 @@ namespace Ryujinx.Graphics.Vulkan cursor = (cursor + 1) & _totalCommandBuffersMask; } - - return default; } + + throw new InvalidOperationException($"Out of command buffers (In use: {_inUseCount}, queued: {_queuedCount}, total: {_totalCommandBuffers})"); } public void Return(CommandBufferScoped cbs)