Notice
Copyright (c) 2016 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html
Status
-
Complete.
-
Approved by the SPIR-V Working group: 2016-08-02
-
Approved by the Khronos Board of Promoters: 2016-09-30
Dependencies
This extension is written against the SPIR-V Specification, Version 1.1 Revision 1.
This extension requires SPIR-V 1.0.
Overview
This extension provides new built-in variables: BaseVertex, BaseInstance, and DrawIndex, to support the OpenGL GL_ARB_shader_draw_parameters extension in SPIR-V.
The new functionality is enabled under the DrawParameters capability.
Extension Name
To use this extension within a SPIR-V module, the following OpExtension must be present in the module:
OpExtension "SPV_KHR_shader_draw_parameters"
Modifications to the SPIR-V Specification, Version 1.1
- (Modify Section 3.21, BuiltIn to include new builtins)
-
BuiltIn Enabling Capabilities 4424
BaseVertex
Base vertex component of vertex ID. See OpenGL GL_ARB_shader_draw_parameters for more detail.DrawParameters
4425
BaseInstance
Base instance component of instance ID. See OpenGL GL_ARB_shader_draw_parameters for more detail.DrawParameters
4426
DrawIndex
Contains the index of the draw currently being processed. See OpenGL GL_ARB_shader_draw_parameters for more detail.DrawParameters
- (Modify Section 3.31, Capability, adding a row to the Capability table)
-
Capability Implicitly Declares 4427
DrawParameters
Shader
Validation Rules
An OpExtension must be added to the SPIR-V for validation layers to check legal use of this extension:
OpExtension "SPV_KHR_shader_draw_parameters"
Revision History
| Rev | Date | Author | Changes |
|---|---|---|---|
1 |
2016-05-31 |
Kerch Holt |
Initial revision |
2 |
2016-05-31 |
Kerch Holt |
Removed "BuiltIn" from name (used in header not doc). |
3 |
2016-08-07 |
Kerch Holt |
Added extension number |
4 |
2016-08-19 |
Daniel Koch |
drawID → drawIndex, drop KHR and add DrawParameters |
5 |
2016-09-02 |
Kerch Holt |
Renumbered tokens as per GitLab issue #52 in SPIR-V |
6 |
2016-09-20 |
Daniel Koch |
Fix extension name in validation rules, standardize dates, remove extension number, update contributors |