public final class NVXMultiviewPerViewAttributes
extends java.lang.Object
SPV_NVX_multiview_per_view_attributes and GL_NVX_multiview_per_view_attributes introduce per-view position and viewport mask attributes arrays, and this extension defines how those per-view attribute arrays are interpreted by Vulkan. Pipelines using per-view attributes may only execute the vertex processing stages once for all views rather than once per-view, which reduces redundant shading work.
A subpass creation flag controls whether the subpass uses this extension. A subpass must either exclusively use this extension or not use it at all.
Some Vulkan implementations only support the position attribute varying between views in the X component. A subpass can declare via a second creation flag whether all pipelines compiled for this subpass will obey this restriction.
Shaders that use the new per-view outputs (e.g. gl_PositionPerViewNV) must also write the non-per-view output (gl_Position), and the values written must be such that gl_Position = gl_PositionPerViewNV[gl_ViewIndex] for all views in the subpass. Implementations are free to either use the per-view outputs or the non-per-view outputs, whichever would be more efficient.
If VK_NV_viewport_array2 is not also supported and enabled, the per-view viewport mask must not be used.
#version 450 core
#extension GL_KHX_multiview : enable
#extension GL_NVX_multiview_per_view_attributes : enable
layout(location = 0) in vec4 position;
layout(set = 0, binding = 0) uniform Block { mat4 mvpPerView[2]; } buf;
void main()
{
// Output both per-view positions and gl_Position as a function
// of gl_ViewIndex
gl_PositionPerViewNV[0] = buf.mvpPerView[0] * position;
gl_PositionPerViewNV[1] = buf.mvpPerView[1] * position;
gl_Position = buf.mvpPerView[gl_ViewIndex] * position;
}
VK_NVX_multiview_per_view_attributesVK_KHR_multiviewSPV_NVX_multiview_per_view_attributes SPIR-V extension.GL_NVX_multiview_per_view_attributes extension for GLSL source languages.VK_NV_viewport_array2.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME
The extension name.
|
static int |
VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION
The extension specification version.
|
static int |
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX
Extends
VkStructureType. |
static int |
VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX
Extends
VkSubpassDescriptionFlagBits. |
static int |
VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX
Extends
VkSubpassDescriptionFlagBits. |
public static final int VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_SPEC_VERSION
public static final java.lang.String VK_NVX_MULTIVIEW_PER_VIEW_ATTRIBUTES_EXTENSION_NAME
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PER_VIEW_ATTRIBUTES_PROPERTIES_NVX
VkStructureType.public static final int VK_SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX
VkSubpassDescriptionFlagBits.
public static final int VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX
VkSubpassDescriptionFlagBits.
Copyright LWJGL. All Rights Reserved. License terms.