Repository navigation
[SPIR-V] Implement WaveMutliPrefix* - #6608
Merged
Steven Perron (s-perron) merged 2 commits intoMay 17, 2024
Merged
Conversation
Nathan Gauër (Keenuts)
approved these changes
May 13, 2024
Natalie Chouinard (sudonatalie)
added a commit
that referenced
this pull request
May 15, 2024
A follow-up change will use the PartitionedExclusiveScanNV GroupOperation, which requires that an additional operand is added to all GroupNonUniformArithmetic instructions. This means that some of the SPIR-V opcodes which are currently categorized as unary will become either unary or binary depending on the GroupOp. Since the arity distinctions between the OpGroupNonUniform* instructions were already somewhat arbitrary, I'm prefacing that change by refactoring them into a single SpirvGroupNonUniformOp instruction type for better reusability. Follow up: #6608
Implements the Shader Model 6.5 WaveMultiPrefix* intrinsic functions
using the group operation from SPV_NV_shader_subgroup_partitioned,
PartitionedExclusiveScanNV, which performs a partitioned exclusive scan
operation across a subset of invocations ("lanes") in a subgroup
("wave"). The subset of the partition is determined by the provided
ballot ("mask") parameter, which follows the same requirements for
valid partitioning and active invocations/lanes as the HLSL parameter.
Note that WaveMultiPrefixCountBits remains unimplemented because it does
not directly map to a SPIR-V GroupNonUniformArithmetic instruction that
accepts the PartitionedExclusiveScanNV Group Operation.
DirectX Spec: https://microsoft.github.io/DirectX-Specs/d3d/HLSL_ShaderModel6_5.html#wavemultiprefix-functions
SPIR-V Extension: https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/NV/SPV_NV_shader_subgroup_partitioned.html
Depends on microsoft#6596
Fixes microsoft#6600
Natalie Chouinard (sudonatalie)
force-pushed
the
wavemultiprefix
branch
from
May 15, 2024 17:35
d46fc48 to
82fa841
Compare
Steven Perron (s-perron)
approved these changes
May 17, 2024
Mxr (SjMxr233)
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
A follow-up change will use the PartitionedExclusiveScanNV GroupOperation, which requires that an additional operand is added to all GroupNonUniformArithmetic instructions. This means that some of the SPIR-V opcodes which are currently categorized as unary will become either unary or binary depending on the GroupOp. Since the arity distinctions between the OpGroupNonUniform* instructions were already somewhat arbitrary, I'm prefacing that change by refactoring them into a single SpirvGroupNonUniformOp instruction type for better reusability. Follow up: microsoft#6608
Mxr (SjMxr233)
pushed a commit
to ShaderHelper/DirectXShaderCompiler
that referenced
this pull request
Jul 24, 2025
Implements the Shader Model 6.5 WaveMultiPrefix* intrinsic functions
using the group operation from SPV_NV_shader_subgroup_partitioned,
PartitionedExclusiveScanNV, which performs a partitioned exclusive scan
operation across a subset of invocations ("lanes") in a subgroup
("wave"). The subset of the partition is determined by the provided
ballot ("mask") parameter, which follows the same requirements for
valid partitioning and active invocations/lanes as the HLSL parameter.
Note that WaveMultiPrefixCountBits remains unimplemented because it does
not directly map to a SPIR-V GroupNonUniformArithmetic instruction that
accepts the PartitionedExclusiveScanNV Group Operation.
DirectX Spec:
https://microsoft.github.io/DirectX-Specs/d3d/HLSL_ShaderModel6_5.html#wavemultiprefix-functions
SPIR-V Extension:
https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/NV/SPV_NV_shader_subgroup_partitioned.html
Depends on microsoft#6596
Fixes microsoft#6600
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements the Shader Model 6.5 WaveMultiPrefix* intrinsic functions
using the group operation from SPV_NV_shader_subgroup_partitioned,
PartitionedExclusiveScanNV, which performs a partitioned exclusive scan
operation across a subset of invocations ("lanes") in a subgroup
("wave"). The subset of the partition is determined by the provided
ballot ("mask") parameter, which follows the same requirements for
valid partitioning and active invocations/lanes as the HLSL parameter.
Note that WaveMultiPrefixCountBits remains unimplemented because it does
not directly map to a SPIR-V GroupNonUniformArithmetic instruction that
accepts the PartitionedExclusiveScanNV Group Operation.
DirectX Spec: https://microsoft.github.io/DirectX-Specs/d3d/HLSL_ShaderModel6_5.html#wavemultiprefix-functions
SPIR-V Extension: https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/NV/SPV_NV_shader_subgroup_partitioned.html
Depends on #6596
Fixes #6600