Description
ViewportMaskNV
-
Decorating a variable with the
ViewportMaskNV
built-in decoration will make that variable contain the viewport mask.In a vertex, tessellation evaluation, or geometry shader, the variable decorated with
ViewportMaskNV
can be written to with the mask of which viewports the primitive produced by that shader will directed.The
ViewportMaskNV
variable must be an array that has ⌈(VkPhysicalDeviceLimits
::maxViewports
/ 32)⌉ elements. When a shader writes to this variable, bit B of element M controls whether a primitive is emitted to viewport 32 × M + B. The viewports indicated by the mask are used to select the viewport transform and scissor rectangle that a primitive will be transformed by.The last active pre-rasterization shader stage (in pipeline order) controls the
ViewportMaskNV
that is used. Outputs in previous shader stages are not used, even if the last stage fails to write theViewportMaskNV
. WhenViewportMaskNV
is written by the final pre-rasterization shader stage, any variable decorated withViewportIndex
in the fragment shader will have the index of the viewport that was used in generating that fragment.If a pre-rasterization shader stage shader entry point’s interface includes a variable decorated with
ViewportMaskNV
, it must write the same value toViewportMaskNV
for all output vertices of a given primitive.
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.