Question about members in VkSubmitInfo with member name ```*count ```

typedef struct VkSubmitInfo {
  .....
    uint32_t                       waitSemaphoreCount;
......
    uint32_t                       commandBufferCount;
......
    uint32_t                       signalSemaphoreCount;

} VkSubmitInfo;

do they all have the same value? does pCommandBuffer[i] correspond to pWaitSemaphores[i] and pSignalSemaphores[i] ?

my understanding is if pCommandbuffer[i] wants to execute, it has to wait for pWaitSemaphores[i] , and after it finished , it signals pSignalSemaphores[i].

if it is , why not have *count member as one single member since they all have the same value instead of 3 of them?

i don’t know if that understanding is correct. or maybe pCommandbuffer[i] has to wait for all pWaitSemaphores and signal all pSignalSemaphores?

The standard, and the documentation page, make it clear what these variables mean:

waitSemaphoreCount is the number of semaphores upon which to wait before executing the command buffers for the batch.

The plural on “command buffers” is not an accident. Similarly:

signalSemaphoreCount is the number of semaphores to be signaled once the commands specified in pCommandBuffers have completed execution.

Again, the plural “commands” is used.

so they don’t have one to one relationship?

I’ll try to correct this, if i understand it correctly,

first we’ll wait for all pWaitSemaphores, then start all the command buffers, after all the buffers are finished , signal all the pSignalSemaphores that are potentially waiting(there might be multiple of them).

Yea, a batch is undivisible. All the semaphores are waited on (given you might want to wait on multiple things) and afterwards all the semaphores are signaled (given that you might want more things to consume the results). If you want to split command buffers, that is what submissions in pSubmits are for, having their own separate set of semaphores.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.