aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-09-02 17:58:30 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2019-09-02 17:58:30 +0200
commit5d84e42590eff42cdb02a3c10227de0c1ca1737a (patch)
treedb46fd0fe766615ce1da505fa6e7b55e902a2498
parent38ec67de2972f9d4734980a7a83bd4baf9784aa5 (diff)
vkh_cmd_buffs_create
-rw-r--r--include/vkh.h1
-rw-r--r--src/vkhelpers.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/include/vkh.h b/include/vkh.h
index 44773f3..2568760 100644
--- a/include/vkh.h
+++ b/include/vkh.h
@@ -144,6 +144,7 @@ VkEvent vkh_event_create (VkhDevice dev);
VkCommandPool vkh_cmd_pool_create (VkhDevice dev, uint32_t qFamIndex, VkCommandPoolCreateFlags flags);
VkCommandBuffer vkh_cmd_buff_create (VkhDevice dev, VkCommandPool cmdPool, VkCommandBufferLevel level);
+void vkh_cmd_buffs_create (VkhDevice dev, VkCommandPool cmdPool, VkCommandBufferLevel level, uint32_t count, VkCommandBuffer* cmdBuffs);
void vkh_cmd_begin (VkCommandBuffer cmdBuff, VkCommandBufferUsageFlags flags);
void vkh_cmd_end (VkCommandBuffer cmdBuff);
void vkh_cmd_submit (VkhQueue queue, VkCommandBuffer *pCmdBuff, VkFence fence);
diff --git a/src/vkhelpers.c b/src/vkhelpers.c
index e3a4f80..b6490b5 100644
--- a/src/vkhelpers.c
+++ b/src/vkhelpers.c
@@ -74,7 +74,14 @@ VkCommandBuffer vkh_cmd_buff_create (VkhDevice dev, VkCommandPool cmdPool, VkCom
VK_CHECK_RESULT (vkAllocateCommandBuffers (dev->dev, &cmd, &cmdBuff));
return cmdBuff;
}
-
+void vkh_cmd_buffs_create (VkhDevice dev, VkCommandPool cmdPool, VkCommandBufferLevel level, uint32_t count, VkCommandBuffer* cmdBuffs){
+ VkCommandBufferAllocateInfo cmd = { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO,
+ .pNext = NULL,
+ .commandPool = cmdPool,
+ .level = level,
+ .commandBufferCount = count };
+ VK_CHECK_RESULT (vkAllocateCommandBuffers (dev->dev, &cmd, cmdBuffs));
+}
void vkh_cmd_begin(VkCommandBuffer cmdBuff, VkCommandBufferUsageFlags flags) {
VkCommandBufferBeginInfo cmd_buf_info = { .sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
.pNext = NULL,