mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Vulkan: Use multiple command pools, one per frame
Instead of resetting two command buffers, now we only have to call vkResetCommandPool once at the start of a frame. NV's recommends using one pool per frame/thread. May offer a very small boost in performance on some systems.
This commit is contained in:
@ -33,7 +33,6 @@ public:
|
||||
|
||||
bool Initialize();
|
||||
|
||||
VkCommandPool GetCommandPool() const { return m_command_pool; }
|
||||
// These command buffers are allocated per-frame. They are valid until the command buffer
|
||||
// is submitted, after that you should call these functions again.
|
||||
VkCommandBuffer GetCurrentInitCommandBuffer()
|
||||
@ -100,9 +99,6 @@ public:
|
||||
void RemoveFencePointCallback(const void* key);
|
||||
|
||||
private:
|
||||
bool CreateCommandPool();
|
||||
void DestroyCommandPool();
|
||||
|
||||
bool CreateCommandBuffers();
|
||||
void DestroyCommandBuffers();
|
||||
|
||||
@ -113,11 +109,10 @@ private:
|
||||
|
||||
void OnCommandBufferExecuted(size_t index);
|
||||
|
||||
VkCommandPool m_command_pool = VK_NULL_HANDLE;
|
||||
|
||||
struct FrameResources
|
||||
{
|
||||
// [0] - Init (upload) command buffer, [1] - draw command buffer
|
||||
VkCommandPool command_pool;
|
||||
std::array<VkCommandBuffer, 2> command_buffers;
|
||||
VkDescriptorPool descriptor_pool;
|
||||
VkFence fence;
|
||||
|
Reference in New Issue
Block a user