1include::meta/VK_EXT_shader_subgroup_ballot.txt[] 2 3*Last Modified Date*:: 4 2016-11-28 5*IP Status*:: 6 No known IP claims. 7*Interactions and External Dependencies*:: 8 - This extension requires the 9 https://www.khronos.org/registry/spir-v/extensions/KHR/SPV_KHR_shader_ballot.html[+SPV_KHR_shader_ballot+] 10 SPIR-V extension. 11 - This extension requires the 12 https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_ballot.txt[+GL_ARB_shader_ballot+] 13 extension for GLSL source languages. 14*Contributors*:: 15 - Jeff Bolz, NVIDIA 16 - Neil Henning, Codeplay 17 - Daniel Koch, NVIDIA Corporation 18 19This extension adds support for the following SPIR-V extension in Vulkan: 20 21 * +SPV_KHR_shader_ballot+ 22 23This extension provides the ability for a group of invocations, which 24execute in parallel, to do limited forms of cross-invocation communication 25via a group broadcast of a invocation value, or broadcast of a bitarray 26representing a predicate value from each invocation in the group. 27 28This extension provides access to a number of additional built-in shader 29variables in Vulkan: 30 31 * code:SubgroupEqMaskKHR, which contains the subgroup mask of the current 32 subgroup invocation, 33 * code:SubgroupGeMaskKHR, which contains the subgroup mask of the 34 invocations greater than or equal to the current invocation, 35 * code:SubgroupGtMaskKHR, which contains the subgroup mask of the 36 invocations greater than the current invocation, 37 * code:SubgroupLeMaskKHR, which contains the subgroup mask of the 38 invocations less than or equal to the current invocation, 39 * code:SubgroupLtMaskKHR, which contains the subgroup mask of the 40 invocations less than the current invocation, 41 * code:SubgroupLocalInvocationId, which contains the index of an 42 invocation within a subgroup, and 43 * code:SubgroupSize, which contains the maximum number of invocations in a 44 subgroup. 45 46Additionally, this extension provides access to the new SPIR-V instructions: 47 48 * code:OpSubgroupBallotKHR, 49 * code:OpSubgroupFirstInvocationKHR, and 50 * code:OpSubgroupReadInvocationKHR, 51 52When using GLSL source-based shader languages, the following variables and 53shader functions from GL_ARB_shader_ballot can map to these SPIR-V built-in 54decorations and instructions: 55 56 * `in uint64_t gl_SubGroupEqMaskARB;` -> code:SubgroupEqMaskKHR, 57 * `in uint64_t gl_SubGroupGeMaskARB;` -> code:SubgroupGeMaskKHR, 58 * `in uint64_t gl_SubGroupGtMaskARB;` -> code:SubgroupGtMaskKHR, 59 * `in uint64_t gl_SubGroupLeMaskARB;` -> code:SubgroupLeMaskKHR, 60 * `in uint64_t gl_SubGroupLtMaskARB;` -> code:SubgroupLtMaskKHR, 61 * `in uint gl_SubGroupInvocationARB;` -> code:SubgroupLocalInvocationId, 62 * `uniform uint gl_SubGroupSizeARB;` -> code:SubgroupSize, 63 * code:ballotARB() -> code:OpSubgroupBallotKHR, 64 * code:readFirstInvocationARB() -> code:OpSubgroupFirstInvocationKHR, and 65 * code:readInvocationARB() -> code:OpSubgroupReadInvocationKHR. 66 67=== New Object Types 68 69None. 70 71=== New Enum Constants 72 73None. 74 75=== New Enums 76 77None. 78 79=== New Structures 80 81None. 82 83=== New Functions 84 85None. 86 87=== New Built-In Variables 88 89 * <<interfaces-builtin-variables-sgeq,code:SubgroupEqMaskKHR>> 90 * <<interfaces-builtin-variables-sgge,code:SubgroupGeMaskKHR>> 91 * <<interfaces-builtin-variables-sggt,code:SubgroupGtMaskKHR>> 92 * <<interfaces-builtin-variables-sgle,code:SubgroupLeMaskKHR>> 93 * <<interfaces-builtin-variables-sglt,code:SubgroupLtMaskKHR>> 94 * <<interfaces-builtin-variables-sgli,code:SubgroupLocalInvocationId>> 95 * <<interfaces-builtin-variables-sgs,code:SubgroupSize>> 96 97=== New SPIR-V Capabilities 98 99 * <<spirvenv-capabilities-table-subgroupballot,SubgroupBallotKHR>> 100 101=== Issues 102 103None. 104 105=== Version History 106 107 * Revision 1, 2016-11-28 (Daniel Koch) 108 - Initial draft 109