The graphics pipeline defines parameters of lots of different states used during rendering. Creating separate pipeline objects every time we need to use slightly different values of some of these parameters would be cumbersome and very impractical. That's why dynamic states are available in Vulkan. We can define a viewport transformation to be one of them. In such a situation, we specify its parameters through a function call recorded in command buffers.
Setting viewport states dynamically
How to do it...
- Take the handle of a command buffer that is in a recording state. Using its handle, initialize a variable of type VkCommandBuffer named command_buffer.
- Specify the number of the first viewport whose parameters should be set. Store the number in a variable...