MCPcopy Create free account
hub / github.com/KhronosGroup/glTF-IBL-Sampler / createCommandBuffer

Method createCommandBuffer

lib/source/vkHelper.cpp:412–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412VkResult IBLLib::vkHelper::createCommandBuffer(VkCommandBuffer& _outCmdBuffer, VkCommandBufferLevel _level) const
413{
414 if (m_commandPool == VK_NULL_HANDLE || m_logicalDevice == VK_NULL_HANDLE)
415 {
416 return VK_RESULT_MAX_ENUM;
417 }
418
419 VkCommandBufferAllocateInfo allocInfo{};
420 allocInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
421 allocInfo.commandPool = m_commandPool;
422 allocInfo.level = _level;
423 allocInfo.commandBufferCount = 1u;
424
425 VkResult res = vkAllocateCommandBuffers(m_logicalDevice, &allocInfo, &_outCmdBuffer);
426
427 if (res != VK_SUCCESS)
428 {
429 printf("Failed to allocate command buffers [%u]\n", res);
430 }
431
432 return res;
433}
434
435VkResult IBLLib::vkHelper::createCommandBuffers(std::vector<VkCommandBuffer>& _outCmdBuffers, uint32_t _count, VkCommandBufferLevel _level) const
436{

Callers 4

uploadImageFunction · 0.80
downloadCubemapFunction · 0.80
download2DImageFunction · 0.80
sampleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected