Hello Guest

How do you use cmdExecuteCommands PointerBuffer argument?

  • 2 Replies
  • 837 Views
Its a PointerBuffer, and yet the idiomatic way to use vulkan's VkCommandBuffer is with a VkCommandBuffer object. How do I derive a PointerBuffer from a collection of VkCommandBuffer objects?


*

Online spasi

  • *****
  • 1989
    • WebHotelier
Re: How do you use cmdExecuteCommands PointerBuffer argument?
« Reply #2 on: May 19, 2017, 07:18:55 »
First of all, vkCmdExecuteCommands is used to record secondary command buffers to execute as part of a primary command buffer. This is fairly advanced functionality, but if it's indeed what you want to do:

Code: [Select]
try (MemoryStack stack = stackPush()) {
    PointerBuffer secondaryCmdBuffers = stack.mallocPointer(count);

    // Fill secondaryCmdBuffers with command buffer handles.
    // You can simply use secondaryCmdBuffers.put(i, cmd_buffer_instance);

    vkCmdExecuteCommands(primaryCmdBuffer, secondaryCmdBuffers);
}