Description
ViewportMaskNV-
Decorating a variable with the
ViewportMaskNVbuilt-in decoration will make that variable contain the viewport mask.In a mesh, vertex, tessellation evaluation, or geometry shader, the variable decorated with
ViewportMaskNVcan be written to with the mask of which viewports the primitive produced by that shader will directed.The
ViewportMaskNVvariable 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, scissor rectangle, and exclusive scissor rectangle that a primitive will be transformed by.The last active pre-rasterization shader stage (in pipeline order) controls the
ViewportMaskNVthat is used. Outputs in previous shader stages are not used, even if the last stage fails to write theViewportMaskNV. WhenViewportMaskNVis written by the final pre-rasterization shader stage, any variable decorated withViewportIndexin 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 toViewportMaskNVfor 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.