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

Mark WaveGetLaneCount as constexpr #4731

Closed
Jasper-Bekkers opened this issue Oct 18, 2022 · 5 comments
Closed

Mark WaveGetLaneCount as constexpr #4731

Jasper-Bekkers opened this issue Oct 18, 2022 · 5 comments
Labels
needs-triage Awaiting triage

Comments

@Jasper-Bekkers
Copy link

Currently one can't easily do this; instead you'd have to create a new shader permutation for every supported wave size.

groupshared uint stuff[WaveGetLaneCount()];
@simondeschenes
Copy link

I would also like to see this supported.

@llvm-beanz
Copy link
Collaborator

WaveGetLaneCount can't be a constexpr. It isn't a compile-time known value. It should be known in the driver compiler but it isn't in the frontend so it can't be constexpr.

The use case of being able to construct a wave-width array could potentially be addressed another way, but constexpr isn't the answer here.

@MarijnS95
Copy link
Contributor

MarijnS95 commented Jul 14, 2023

@llvm-beanz perhaps leave this open (and retitle) for that "other way"?

@llvm-beanz
Copy link
Collaborator

@MarijnS95, I think the correct approach for this is to add some sort of support for specialization constants to DXIL which we have tracked in the hlsl-specs repo issue #16.

While at first glance these may seem slightly orthogonal, both require runtime & driver initialized constants, which is what this is too. We have the same challenge with #4290.

So, I think the TL;DR here is that this will all be rolled into specialization constant support, and we don't really need multiple issues tracking it.

@MarijnS95
Copy link
Contributor

MarijnS95 commented Jul 19, 2023

@llvm-beanz that sounds like the perfect match for specialization constants, as long as it is tracked somewhere that WaveGetLaneCount() should be treated as such? Seems that (treating driver-defined constants as specialization constants) is covered in microsoft/hlsl-specs#16 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Awaiting triage
Projects
Archived in project
Development

No branches or pull requests

4 participants