VKCMDPUSHCONSTANTS(3)

NAME
vkCmdPushConstants - Update the values of push constants

C SPECIFICATION

To update push constants, call:

    void vkCmdPushConstants(
        VkCommandBuffer                             commandBuffer,
        VkPipelineLayout                            layout,
        VkShaderStageFlags                          stageFlags,
        uint32_t                                    offset,
        uint32_t                                    size,
        const void*                                 pValues);

PARAMETERS

    • commandBuffer is the command buffer in which the push constant update will be recorded.

    • layout is the pipeline layout used to program the push constant updates.

    • stageFlags is a bitmask of VkShaderStageFlagBits specifying the shader stages that will use the push constants in the updated range.

    • offset is the start offset of the push constant range to update, in units of bytes.

    • size is the size of the push constant range to update, in units of bytes.

    • pValues is an array of size bytes containing the new push constant values.

DESCRIPTION
Valid Usage

    • stageFlags must match exactly the shader stages used in layout for the range specified by offset and size

    • offset must be a multiple of 4

    • size must be a multiple of 4

    • offset must be less than VkPhysicalDeviceLimits::maxPushConstantsSize

    • size must be less than or equal to VkPhysicalDeviceLimits::maxPushConstantsSize minus offset
Valid Usage (Implicit)

    • commandBuffer must be a valid VkCommandBuffer handle

    • layout must be a valid VkPipelineLayout handle

    • stageFlags must be a valid combination of VkShaderStageFlagBits values

    • stageFlags must not be 0

    • pValues must be a pointer to an array of size bytes

    • commandBuffer must be in the recording state

    • The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations

    • size must be greater than 0

    • Both of commandBuffer, and layout must have been created, allocated, or retrieved from the same VkDevice
Host Synchronization

    • Host access to commandBuffer must be externally synchronized
Command Properties
Command Buffer Levels | Render Pass Scope | Supported Queue Types
Primary Secondary | Both | GRAPHICS COMPUTE

SEE ALSO

VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags

DOCUMENT NOTES

For more information, see the Vulkan Specification at URL

https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html#vkCmdPushConstants

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification,not directly.

COPYRIGHT

Copyright (c) 2014-2016 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.

AUTHOR

Khronos Group
    Author.