O'Reilly logo

Learning Vulkan by Parminder Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required