Function Prototype

vkEndCommandBuffer

Finish recording a command buffer

To complete recording of a command buffer, call:

VkResult vkEndCommandBuffer(
    VkCommandBuffer commandBuffer);
  • commandBuffer is the command buffer to complete recording.

The command buffer must have been in the recording state, and, if successful, is moved to the executable state.

If there was an error during recording, the application will be notified by an unsuccessful return code returned by vkEndCommandBuffer, and the command buffer will be moved to the invalid state.

In case the application recorded one or more video encode operations into the command buffer, implementations may return the VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error if any of the specified Video Std parameters do not adhere to the syntactic or semantic requirements of the used video compression standard, or if values derived from parameters according to the rules defined by the used video compression standard do not adhere to the capabilities of the video compression standard or the implementation.

Applications should not rely on the VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR error being returned by any command as a means to verify Video Std parameters, as implementations are not required to report the error in any specific set of cases.

Valid Usage

VUID-vkEndCommandBuffer-commandBuffer-00060

If commandBuffer is a primary command buffer, there must not be an active render pass instance

VUID-vkEndCommandBuffer-commandBuffer-00061

All queries made active during the recording of commandBuffer must have been made inactive

VUID-vkEndCommandBuffer-None-01978

Conditional rendering must not be active

VUID-vkEndCommandBuffer-None-06991

There must be no video session object bound

VUID-vkEndCommandBuffer-commandBuffer-01815

If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT

VUID-vkEndCommandBuffer-commandBuffer-00062

If commandBuffer is a secondary command buffer, there must not be an outstanding vkCmdDebugMarkerBeginEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdDebugMarkerEndEXT

Valid Usage (Implicit)

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized ::