summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2016-09-28 23:04:02 +1000
committerStenzek <stenzek@gmail.com>2016-10-01 02:40:03 +1000
commit5f66cf5ed737186add9f1d93231cfa82636bb9fb (patch)
treefdd060d4a8813e5afdd25f0f18c28917bbd2cd17 /Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
parentbac8c2d44147395e31c4d5a2247be1b449139272 (diff)
Vulkan: Only submit init/upload command buffer when it has commands
This way we're not submitting empty buffers when it's unnecessary.
Diffstat (limited to 'Source/Core/VideoBackends/Vulkan/CommandBufferManager.h')
-rw-r--r--Source/Core/VideoBackends/Vulkan/CommandBufferManager.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
index 73ab126f97..3f0148db9c 100644
--- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
+++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.h
@@ -35,8 +35,9 @@ public:
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() const
+ VkCommandBuffer GetCurrentInitCommandBuffer()
{
+ m_frame_resources[m_current_frame].init_command_buffer_used = true;
return m_frame_resources[m_current_frame].command_buffers[0];
}
VkCommandBuffer GetCurrentCommandBuffer() const
@@ -119,6 +120,7 @@ private:
std::array<VkCommandBuffer, 2> command_buffers;
VkDescriptorPool descriptor_pool;
VkFence fence;
+ bool init_command_buffer_used;
bool needs_fence_wait;
std::vector<DeferredResourceDestruction> cleanup_resources;