Push constant updates
Push constants are specially designed to update the shader constant data using the command buffer instead of updating the resources with the write or copy descriptors.
Note
Push constants offer a high-speed optimized path to update the constant data in the pipeline.
In this section, we will quickly implement an example to demonstrate a push constant. We will learn how push constants are used with command buffers to update the resource contents in the shader. This example defines two types of resources in the fragment shader—constColor
and mixerValue
—within the push constant uniform block pushConstantsColorBlock
. The constColor
resource contains an integer value that is used as a flag to render the rotating cube in a solid color ...
Get Learning Vulkan now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.