Some of the vkCmd*
functions specify when some parameters are consumed or not. For example, in the documentation of vkCmdBindDescriptorSets
:
The contents of pDynamicOffsets are consumed immediately during execution of vkCmdBindDescriptorSets.
However most of them do not clarify. Are all parameters consumed during the the vkCmd*
call? For example, in the following code:
void copyHelper() {
VkBufferCopy copy_region = {...};
vkCmdCopyBuffer(cmd_buffer, from_buffer, to_buffer, 1, ©_region);
}
after calling copyHelper()
, copy_region
is not in scope anymore although cmd_buffer
hasn't been submitted yet. Do I need to store copy_region
somewhere so that it stays valid? Or is it immediately consumed when calling vkCmdCopyBuffer
? What about the rest of the vkCmd*
functions?
Thanks.
There is no per-command clarification, because all commands operate under the following blanket statement:
Emphasis in the specification. The implementation has to be finished using the contents of any memory you pass by the time the function returns. Whether unformatted memory like a
void*
or data structures.Note that "duration" is defined as: