The new Pascal OpenGL extensions have arrived
NVIDIA has just published the OpenGL extensions that expose the Pascal GPU architecture’s new hardware features. The extensions are available on GTX 1070 and GTX 1080 GPUs starting with the 367.XX drivers:
- Single Pass Stereo: GL_NV_stereo_view_rendering
- Lens Matched Shading: GL_NV_clip_space_w_scaling
- Improved Conservative Rasterization: GL_NV_conservative_raster_pre_snap_triangles
- Double Precision Atomic Operations: GL_NV_shader_atomic_float64
The remainder of this article provides an overview over those extensions, which complements the programming guide and sample code available in our VRWorks 2.0 SDK.
Single Pass Stereo
Virtual reality (VR) applications often render a single logical scene from multiple views corresponding to a pair of eyes. The views (eyes) are separated by a fixed offset in the X direction.
Traditionally, multiple views are rendered via multiple rendering passes. This is expensive for the GPU because the objects in the scene must be transformed, rasterized, shaded, and fragment processed twice which is redundant. This is also expensive for the CPU because the scene graph needs to be visited multiple times with driver validation happening for each view. Rendering N passes tends to take N times longer than a single pass.
The new GL_NV_stereo_view_rendering extension provides a mechanism to render binocular (stereo) views from a single stream of OpenGL rendering commands. Vertex, tessellation, and geometry shaders
can output two positions for each vertex corresponding to the two eye views. The positions from each view
may be sent to different viewports or layers or both.
To see how to properly use the extension, check out the “gl_stereo_view_rendering” sample included in the VRWorks 2.0 SDK.
Lens Matched Shading
Virtual Reality (VR) applications often involve a post-processing step to apply a "barrel" distortion to the rendered image to correct the "pincushion" distortion introduced by the optics in a VR device. The barrel distorted image has lower resolution along the edges compared to the center. Using standard rendering where the original image is rendered at uniform high resolution across the complete image, a lot of pixels towards the edges do not actually end up being visible to the user.
The new GL_NV_clip_space_w_scaling extension provides a mechanism to render VR scenes at a non-uniform resolution, in particular a resolution that falls linearly from the center towards the edges. This is achieved by scaling the "w" coordinate of the vertices in the clip space before perspective is divided as a function of the "x" and "y" coordinates.
The VRWorks 2.0 SDK contains the gl_clip_space_w_scaling sample which illustrates this extension.
Improved Conservative Rasterization
Pascal’s new GL_NV_conservative_raster_pre_snap_triangles extension exposes an additional conservative rasterization mode that rasterizes primitives more conservatively. This can be useful for "binning" and voxelization algorithms since it may generate fragments for pixels covered by triangles with zero area, or for pixels that are adjacent to but not covered by any triangle. This modified behavior may be useful in compensating for rounding errors caused by snapping vertex positions to a sub-pixel grid during rasterization.
Double Precision Atomic Operations
The new GL_NV_shader_atomic_float64 extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform atomic read-modify-write operations to buffer or shared memory with double-precision floating-point components. The set of atomic operations provided by this extension is limited to additions and exchanges. Providing atomic add support allows shaders to atomically accumulate the sum of double-precision floating-point values into buffer memory across multiple (possibly concurrent) shader invocations.