Name Strings

SPV_NV_stereo_view_rendering

Contact

To report problems with this extension, please open a new issue at:

Contributors

  • Daniel Koch, NVIDIA

Status

  • Complete

Version

Last Modified Date

2017-02-15

Revision

2

Dependencies

This extension is written against the SPIR-V Specification, Version 1.1 Revision 4.

This extension requires SPIR-V 1.0.

This extension requires SVP_NV_viewport_array2.

Overview

This extension adds a new capability to support the OpenGL GL_NV_stereo_view_rendering extension in SPIR-V.

The new ShaderStereoViewNV capability adds two builtin variables, SecondaryPositionNV and SecondaryViewportMaskNV, which can be exported from Vertex, Tessellation or Geometry shaders, or imported to Tessellation or Geometry shaders.

The SecondaryPositionNV builtin decoration corresponds to the gl_SecondaryPositionNV variable in GLSL and is used to specify the position for the second view.

The SecondaryViewportMaskNV builtin decoration corresponds to the gl_SecondaryViewportMaskNV[] variable in GLSL and is used to specify the viewport mask for the second view.

This capability also adds the SecondaryViewportRelativeNV decoration that corresponds to the secondary_view_offset layout qualifier that can be applied to the gl_Layer geometry shader output variable in GLSL.

Extension Name

To use this extension within a SPIR-V module, the following OpExtension must be present in the module:

OpExtension "SPV_NV_stereo_view_rendering"

New Capabilities

This extension introduces a new capability:

ShaderStereoViewNV

New Decorations

Decoration added under the ShaderStereoViewNV capability:

SecondaryViewportRelativeNV

New Builtins

Two new builtins are added as outputs for the Vertex, Tessellation and Geometry Execution Models under the ShaderStereoViewNV capability:

SecondaryPositionNV
SecondaryViewportMaskNV

SecondaryPositionNV can also be used as an input for the Tesselation and Geometry Execution Models.

New Instructions

None.

Token Number Assignments

SecondaryViewportRelativeNV

5256

SecondaryPositionNV

5257

SecondaryViewportMaskNV

5258

ShaderStereoViewNV

5259

Modifications to the SPIR-V Specification, Version 1.1

(Modify Section 3.20, Decoration, adding a row to the Decoration table)
Decoration Enabling Capabilities Extra Operands

5256

SecondaryViewportRelativeNV
Apply to a variable. Indicates the layer offset for primitives in the second view. If used with ViewportRelativeNV, the layer used for rendering primitives of the second view is computed by adding the value of the variable decorated with ViewportIndex to the value specified by SecondaryViewportRelativeNV Only valid for the Output Storage Class.

ShaderStereoViewNV

Literal Number Offset

(Modify Section 3.21, BuiltIn)

(add two new rows to the BuiltIn table)

BuiltIn Enabling Capabilities

5257

SecondaryPositionNV
Output vertex position for secondary view in Vertex, Tessellation, or Geometry Execution Model, and input secondary view position for Tessellation and Geometry Execution Models. See Vulkan or OpenGL API specifications for more detail.

ShaderStereoViewNV

5258

SecondaryViewportMaskNV
Output secondary viewport mask in Vertex, Tessellation, or Geometry Execution Model. See Vulkan or OpenGL API specifications for more detail.

ShaderStereoViewNV

(Modify Section 3.31, Capability, add a new row to the Capability table)
Capability Depends On Enabled by Extension

5259

ShaderStereoViewNV

ShaderViewportMaskNV

SPV_NV_stereo_view_rendering

Validation Rules

An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:

OpExtension "SPV_NV_stereo_view_rendering"

Issues

None yet!

Revision History

Rev Date Author Changes

1

2016-12-18

Daniel Koch

Initial draft

2

2017-02-15

Daniel Koch

Mark complete.