Name Strings
SPV_EXT_demote_to_helper_invocation
Contact
To report problems with this extension, please open a new issue at:
Contributors
-
Jeff Bolz, NVIDIA Corporation
-
Alan Baker, Google LLC
Notice
Copyright (c) 2019 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html
Status
-
Complete.
Version
Last Modified Date |
2019-06-06 |
Revision |
1 |
Dependencies
This extension is written against the SPIR-V Specification, Version 1.4 Revision 1.
This extension requires SPIR-V 1.0.
Overview
This extension adds a new OpDemoteToHelperInvocationEXT instruction which is similar to OpKill in that it suppresses subsequent stores and writes to outputs, but is not a flow control instruction and does not necessarily terminate the shader invocation. This is a better match for D3D’s discard instruction, and preserves the ability to rely on uniform flow control for derivatives after the discard.
This extension also adds a new OpIsHelperInvocationEXT instruction which returns whether the invocation is currently a helper invocation. That is, at the beginning of a fragment shader invocation it returns the same value as the HelperInvocation input, and after demotion it returns true. The HelperInvocation builtin decoration is used on a variable in the Input storage class, and it wouldn’t make sense for an input variable’s value to change over the course of the invocation’s execution.
Extension Name
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_EXT_demote_to_helper_invocation"
Modifications to the SPIR-V Specification, Version 1.4
Capabilities
Modify Section 3.31, "Capability", adding these rows to the Capability table:
Capability | Enabling Capabilities | |
---|---|---|
5379 |
DemoteToHelperInvocationEXT |
Shader |
Instructions
Modify Section 3.32.1, "Miscellaneous Instructions", adding the new instructions:
Issues
None.
Revision History
Rev | Date | Author | Changes |
---|---|---|---|
1 |
2019-06-06 |
Jeff Bolz |
Initial revision |