Name Strings

SPV_KHR_post_depth_coverage

Contact

See Issues list in the Khronos SPIRV-Headers repository: https://github.com/KhronosGroup/SPIRV-Headers

Contributors

  • Daniel Koch, NVIDIA

Notice

Copyright (c) 2017 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html

Status

  • Complete

  • Approved by the SPIR Working Group: 2017-05-10

  • Approved by the Khronos Board of Promoters: 2017-06-30

Version

Last Modified Date

2017-07-07

Revision

3

Dependencies

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

This extension requires SPIR-V 1.0.

Overview

This extension provides a capability to allow a new execution mode for post depth coverage to support the GL_ARB_post_depth_coverage and GL_EXT_post_depth_coverage extensions.

The new functionality is enabled under the PostDepthCoverageCapability capability.

Extension Name

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

OpExtension "SPV_KHR_post_depth_coverage"

New Execution Mode

This extension introduces a new execution mode:

PostDepthCoverage

New Capabilities

This extension introduces a new capability:

SampleMaskPostDepthCoverage

New Builtins

None.

New Instructions

None.

Token Number Assignments

PostDepthCoverage

4446

SampleMaskPostDepthCoverage

4447

Modifications to the SPIR-V Specification, Version 1.1

(Modify Section 3.6, Execution Mode, adding a row to the Execution Mode table)
Execution Mode Required Capability Extra Operands

4446

PostDepthCoverage
The input variable decorated with SampleMask will reflect the result of the EarlyFragmentTests. Only valid with the Fragment Execution Model.

SampleMaskPostDepthCoverage

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

4447

SampleMaskPostDepthCoverage

SampleRateShading

SPV_KHR_post_depth_coverage

Validation Rules

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

OpExtension "SPV_KHR_post_depth_coverage"
(Modify Section 2.16.2, Validation Rules for Shader Capabilities, adding a new rule)

An OpEntryPoint with the PostDepthCoverage Execution Model must also set the EarlyFragmentTests Execution Mode.

Issues

  1. What should we call the capability?

    DISCUSSION: Can both the execution mode and capability have the same name? It seems like it could be confusing (documentation and code-wise) even if it is technically possible. The Capability suffix would be redundant.

    RESOLVED: Call it SampleMaskPostDepthCoverage, similar to SampleMaskCoverageOverrideNV since this is modifying the semantics of the SampleMask decorated variables. Other options considered were PostDepthCoverage or PostDepthCoverageCapability.

  2. Should the EarlyFragmentTests Execution Mode be explicit or implicit when PostDepthCoverage is enabled?

    RESOLVED: In GL_EXT_post_depth_coverage, both the early_fragment_test and post_depth_coverage layouts needed to be explicitly set. In GL_ARB_post_depth_coverage, the early_fragment_test was made implicit when post_depth_coverage was enabled as there is no other sensible way of using post depth coverage. However, since SPIR-V is lower-level than GLSL and more explicit/verbose, it follows that both Execution Modes should be explicitly declared and the GLSL front-end can ensure that both modes are specified when either extension is used, and it should also be simpler for consumers.

Revision History

Rev Date Author Changes

1

2017-04-25

Daniel Koch

Initial revision

2

2017-05-12

David Neto

Record approval by SPIR Working Group

3

2017-07-07

Daniel Koch

Record ratification