Increase light command buffer pool to 2 command buffers, throw rather than returning invalid cbs

This commit is contained in:
gdk 2022-06-21 23:10:16 -03:00
parent cd3ad0a6ab
commit 3b9bf0666f

View file

@ -77,7 +77,8 @@ namespace Ryujinx.Graphics.Vulkan
api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError(); 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; _totalCommandBuffersMask = _totalCommandBuffers - 1;
_commandBuffers = new ReservedCommandBuffer[_totalCommandBuffers]; _commandBuffers = new ReservedCommandBuffer[_totalCommandBuffers];
@ -236,9 +237,9 @@ namespace Ryujinx.Graphics.Vulkan
cursor = (cursor + 1) & _totalCommandBuffersMask; 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) public void Return(CommandBufferScoped cbs)