Function Prototype

vkCmdPushConstants2

Update the values of push constants

To update push constants, call:

void vkCmdPushConstants2(
    VkCommandBuffer commandBuffer,
    const VkPushConstantsInfo*        pPushConstantsInfo);
void vkCmdPushConstants2KHR(
    VkCommandBuffer commandBuffer,
    const VkPushConstantsInfo*        pPushConstantsInfo);
  • commandBuffer is the command buffer in which the push constant update will be recorded.
  • pPushConstantsInfo is a pointer to a VkPushConstantsInfo structure.

Valid Usage

VUID-vkCmdPushConstants2-commandBuffer-11295

If commandBuffer is a secondary command buffer, it must have begun with VkCommandBufferInheritanceDescriptorHeapInfoEXT::pSamplerHeapBindInfo equal to NULL

VUID-vkCmdPushConstants2-commandBuffer-11296

If commandBuffer is a secondary command buffer, it must have begun with VkCommandBufferInheritanceDescriptorHeapInfoEXT::pResourceHeapBindInfo equal to NULL

Valid Usage (Implicit)

VUID-vkCmdPushConstants2-pPushConstantsInfo-parameter

pPushConstantsInfo must be a valid pointer to a valid VkPushConstantsInfo structure

VUID-vkCmdPushConstants2-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support VK_QUEUE_COMPUTE_BIT, or VK_QUEUE_GRAPHICS_BIT operations

VUID-vkCmdPushConstants2-videocoding

This command must only be called outside of a video coding scope

Host Synchronization

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