Skip to content
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

[Feature Request] WaveSize attribute support for Mesh and Amplification shaders #137

Open
Devaniti opened this issue Dec 9, 2023 · 2 comments
Labels
enhancement New feature or request Requires Shader Model Feature requests that require DXIL and Shader Model updates

Comments

@Devaniti
Copy link

Devaniti commented Dec 9, 2023

Is your feature request related to a problem? Please describe.
Despite the fact that Mesh and Amplification shaders are very similar to compute shaders, they are not allowed to have WaveSize attribute. Compiling given shader as as_6_6 fails:

[WaveSize(32)]
[numthreads(32, 1, 1)]
void main(uint DTiD : SV_DispatchThreadID, uint GTiD : SV_GroupThreadID) 
{
}

with error: attribute WaveSize only valid for CS.
If GPU advertises support for multiple different wave sizes, you can not force it to select wave size your shader is compatible with.

Describe the solution you'd like
WaveSize should be valid on Mesh and Amplification shaders
Reasoning for supporting WaveSize on AS/MS is same as for CS described in HLSL Wave Size doc

Describe alternatives you've considered
In case when GPU supports multiple wave sizes, your only option is to author shaders that are compatible with any of supported wave size. The drawbacks of such approach are:

  • To test such shader you would still need WaveSize attribute to confirm that it runs as expected on different wave sizes.
  • You can't set up group size to match wave size, meaning you are forced to use groupshared memory to share data between waves inside the threadgroup, which can potentially be slower.
  • It's easier to author shaders that only support single wave size when prototyping.
@Devaniti Devaniti added enhancement New feature or request needs-triage labels Dec 9, 2023
@llvm-beanz llvm-beanz transferred this issue from microsoft/DirectXShaderCompiler Dec 11, 2023
@llvm-beanz llvm-beanz added the Requires Shader Model Feature requests that require DXIL and Shader Model updates label Dec 11, 2023
@llvm-beanz
Copy link
Collaborator

Moving to hlsl-specs since this is a language change that requires a shader model change.

@damyanp damyanp added this to the Shader Model Backlog milestone May 8, 2024
@damyanp damyanp moved this to Triaged in HLSL Triage May 8, 2024
@Nielsbishere
Copy link

Okay so I guess this is not supported currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Requires Shader Model Feature requests that require DXIL and Shader Model updates
Projects
Status: Triaged
Development

No branches or pull requests

4 participants