-
Notifications
You must be signed in to change notification settings - Fork 718
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
[SPIRV] Missing gl_NumWorkGroups #4217
Comments
Hi @Eichenherz! There is not currently an HLSL equivalent to In the meantime, you might consider passing the information through a constant buffer (UBO in GL speak) good luck! |
Yes, precisely for HLSL to SPIRV. I did try the vk::ext_decorate(24) as that's the NumWorkgroups ID. But it would not produce any "OpDecorate Builtin NumWorkgroups". |
Sorry for being late. We will take a look. Definitely, we have to consider adding some new intrinsics. We currently experience intense workloads. It can be delayed. Sorry about that in advance. |
|
I think we can define a variable like the following example:
However, the validation layer report an error
We have to check the variable storage class in this line and add it as an operand of the entry point if it is an |
Do you have any update on this issue? I'm keen to take advantage of the code snipped you posted above but I'm running into the same |
This is going to be a bigger issues to fix. I don't want to just do another hack with the existing inline spir-v. I'm going to look into revamping the whole feature. |
I opened microsoft/hlsl-specs#59. This should add a new attribute that can be used to properly define builtin input and output. |
Also looking for a similar fix regarding access to Compute Shader globals (gl_GlobalInvocationID, gl_LocalInvocationIndex etc). Please note that these need to be globally accessible from a shader file that is
In complex shader implementations it's really cumbersome to pass around the Thanks in advance! |
@kpentaris That is the current plan in microsoft/hlsl-specs#59. |
and when will it land in DXC? |
No idea when it will land. |
It seems possible to override an existing input as a workaround. Eg: im currently (ab)using SV_GroupIndex to get the SubgroupID: |
…6027) I definitely think it would look better if we allowed these attributes on variables, ie microsoft/hlsl-specs#76. I haven't fully investigated how involved it would be to implement, but my intuition is that it wouldn't take that much more work. Fixes #4217.
@kptentaris |
I'm currently using this to atomically count the workgroups as such:
In SPIRV gl_NumWorkGroups would be:
How do I access the same BuiltIn in HLSL as it's not exposed through any SV ?
The text was updated successfully, but these errors were encountered: