The viewport defines a part of an attachment (image) to which the clip's space will be mapped. The scissor test allows us to additionally confine a drawing to the specified rectangle within the specified viewport dimensions. The scissor test is always enabled; we can only set up various values for its parameters. This can be done statically during the pipeline creation, or dynamically. The latter is done with a function call recorded in a command buffer.
Setting scissor states dynamically
How to do it...
- Store the handle of a command buffer that is in a recording state in a variable of type VkCommandBuffer named command_buffer.
- Specify the number of the first scissor rectangle in a variable of type uint32_t named first_scissor. Remember that the number of scissor...