Allow Command Buffers to be allocated and freed Added functionality so that the CommandPool can allocate and free command buffer objects. Bug b/119827933 Change-Id: I190ba3cd7738f2b5e37b196a0abba6d07cfae173 Reviewed-on: https://swiftshader-review.googlesource.com/c/22748 Tested-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Vulkan/VkCommandPool.hpp b/src/Vulkan/VkCommandPool.hpp index 46b1426..05135c1 100644 --- a/src/Vulkan/VkCommandPool.hpp +++ b/src/Vulkan/VkCommandPool.hpp
@@ -16,6 +16,7 @@ #define VK_COMMAND_POOL_HPP_ #include "VkObject.hpp" +#include <set> namespace vk { @@ -29,7 +30,11 @@ static size_t ComputeRequiredAllocationSize(const VkCommandPoolCreateInfo* pCreateInfo); + VkResult allocateCommandBuffers(VkCommandBufferLevel level, uint32_t commandBufferCount, VkCommandBuffer* pCommandBuffers); + void freeCommandBuffers(uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); + private: + std::set<VkCommandBuffer>* commandBuffers; }; static inline CommandPool* Cast(VkCommandPool object)