-
Notifications
You must be signed in to change notification settings - Fork 329
Introduce Subgroup Operations Extension #954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 15 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
57c51e6
Update index.bs
mehmetoguzderin 30265b0
Update index.bs
mehmetoguzderin fb72312
Update index.bs
mehmetoguzderin eff4448
Update index.bs
mehmetoguzderin b458051
Update index.bs
mehmetoguzderin dadbdf5
Update index.bs
mehmetoguzderin 7b08f77
Update index.bs
mehmetoguzderin 7f40783
Update index.bs
mehmetoguzderin 649d3d0
Add operations
mehmetoguzderin 1eb1337
Format templated parameter
mehmetoguzderin 364141d
Fix comment
mehmetoguzderin 6430da5
Reduce attributes, fix ballot
mehmetoguzderin 98e9ac9
Denormalize definitions
mehmetoguzderin ed13541
Increase ballot return size
mehmetoguzderin 5423c09
Update index.bs
mehmetoguzderin f63d2cd
Update index.bs
mehmetoguzderin 3b9dc8f
Remove line break
mehmetoguzderin 40e9311
Remove indexed broadcast
mehmetoguzderin 438b166
Merge branch main into subgroup-operations
mehmetoguzderin 20d2474
Match reorg
mehmetoguzderin 2817b8c
Match rename
mehmetoguzderin 606aad3
Restrict by DXC Types
mehmetoguzderin 97f4136
Merge branch 'main' into subgroup-operations
mehmetoguzderin d06ad89
resolve conflict
mehmetoguzderin 4862ae2
Remove leader concept
mehmetoguzderin 12b284e
Test CI
mehmetoguzderin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1110,6 +1110,12 @@ variable_decoration | |
|
||
[[builtin global_invocation_id]] | ||
OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId | ||
|
||
[[builtin subgroup_size]] | ||
OpDecorate %gl_SubgroupSize BuiltIn SubgroupSize | ||
|
||
[[builtin subgroup_invocation_idx]] | ||
OpDecorate %gl_SubgroupInvocationID BuiltIn SubgroupLocalInvocationId | ||
</xmp> | ||
</div> | ||
|
||
|
@@ -1129,6 +1135,14 @@ type, function decorations and storage class. | |
<tr><td>local_invocation_id<td>vec3<u32><td>Compute Input | ||
<tr><td>global_invocation_id<td>vec3<u32><td>Compute Input | ||
<tr><td>local_invocation_idx<td>u32<td>Compute Input | ||
<tr><td>subgroup_size<td>u32<td>Compute Input<br> | ||
Exists if "subgroup-operations"<br> | ||
is both supported by the device/user<br> | ||
and is enabled in requestDevice | ||
<tr><td>subgroup_invocation_idx<td>u32<td>Compute Input<br> | ||
Exists if "subgroup-operations"<br> | ||
is both supported by the device/user<br> | ||
and is enabled in requestDevice | ||
</table> | ||
|
||
<pre class='def'> | ||
|
@@ -2747,6 +2761,38 @@ TODO(dsinclair): Add Level-of-Detail via explicit gradient. "Grad" image operand | |
TODO(dsinclair): Need gather operations | ||
</pre> | ||
|
||
## Subgroup built-in functions ## {#subgroup-builtin-functions} | ||
|
||
<table class='data'> | ||
<thead> | ||
<tr><td>Subgroup built-in functions<td>SPIR-V | ||
</thead> | ||
<tr><td>subgroup_is_first() -> bool<td>OpGroupNonUniformElect | ||
<tr><td>subgroup_all(bool) -> bool<td>OpGroupNonUniformAll | ||
<tr><td>subgroup_any(bool) -> bool<td>OpGroupNonUniformAny | ||
<tr><td>subgroup_ballot(bool) -> vec4<u32><td>OpGroupNonUniformBallot | ||
<tr><td>subgroup_broadcast(Scalar,u32) -> Scalar<td>OpGroupNonUniformBroadcast | ||
<tr><td>subgroup_broadcast_first(Scalar) -> Scalar<td>OpGroupNonUniformBroadcastFirst | ||
<tr><td>subgroup_add(Integral) -> Integral<td>OpGroupNonUniformIAdd with Reduce | ||
<tr><td>subgroup_add(Floating) -> Floating<td>OpGroupNonUniformFAdd with Reduce | ||
<tr><td>subgroup_mul(Integral) -> Integral<td>OpGroupNonUniformIMul with Reduce | ||
<tr><td>subgroup_mul(Floating) -> Floating<td>OpGroupNonUniformFMul with Reduce | ||
<tr><td>subgroup_min(Integral) -> Integral<td>OpGroupNonUniformUMin or OpGroupNonUniformSMin with Reduce | ||
<tr><td>subgroup_min(Floating) -> Floating<td>OpGroupNonUniformFMin with Reduce | ||
<tr><td>subgroup_max(Integral) -> Integral<td>OpGroupNonUniformUMax or OpGroupNonUniformSMax with Reduce | ||
<tr><td>subgroup_max(Floating) -> Floating<td>OpGroupNonUniformFMax with Reduce | ||
<tr><td>subgroup_and(Integral) -> Integral<td>OpGroupNonUniformBitwiseAnd | ||
<tr><td>subgroup_or(Integral) -> Integral<td>OpGroupNonUniformBitwiseOr | ||
<tr><td>subgroup_xor(Integral) -> Integral<td>OpGroupNonUniformBitwiseXor | ||
<tr><td>subgroup_prefix_add(Integral) -> Integral<td>OpGroupNonUniformIAdd with ExclusiveScan | ||
<tr><td>subgroup_prefix_add(Floating) -> Floating<td>OpGroupNonUniformFAdd with ExclusiveScan | ||
<tr><td>subgroup_prefix_mul(Integral) -> Integral<td>OpGroupNonUniformIMul with ExclusiveScan | ||
<tr><td>subgroup_prefix_mul(Floating) -> Floating<td>OpGroupNonUniformFMul with ExclusiveScan | ||
</table> | ||
|
||
Note: Subgroup functions exist if "subgroup-operations" is both supported | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
by the device/user agent and is enabled in requestDevice. | ||
|
||
# Glossary # {#glossary} | ||
|
||
<table class='data'> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to specify this as "both", since the second one requires the first one. We should just talk about what's enabled on the device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took that from
6.3. Texture Formats
in host spec, does it look good now?