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

gl_WorkGroupSize must be a constant #3910

Closed
kevinboulain opened this issue Apr 9, 2024 · 0 comments · Fixed by #3925
Closed

gl_WorkGroupSize must be a constant #3910

kevinboulain opened this issue Apr 9, 2024 · 0 comments · Fixed by #3925
Assignees
Labels
goal:client support Needed to support a slang use case GoodFirstBug Great bug for people getting going in slang codebase kind:bug something doesn't work like it should

Comments

@kevinboulain
Copy link

(Thanks for glsl.meta.slang it's quite helpful to port over GLSL code.)

This shader:

import "glsl";

[shader("compute")] [numthreads(256, 1, 1)] void compute() {
  const uint x = gl_WorkGroupSize.x;
}

When compiled like this (v2024.1.6) and passed through spirv-val will complain that gl_WorkGroupSize isn't decorated as it should:

slangc compute.slang -target spirv -o compute.spv -emit-spirv-directly -fvk-use-entrypoint-name
spirv-val compute.spv 
error: line 7: BuiltIn decoration on target <id> '9[%gl_WorkGroupSize]' must be a constant for WorkgroupSize
  OpDecorate %gl_WorkGroupSize BuiltIn WorkgroupSize
@ArielG-NV ArielG-NV added kind:bug something doesn't work like it should GoodFirstBug Great bug for people getting going in slang codebase goal:client support Needed to support a slang use case labels Apr 9, 2024
@csyonghe csyonghe self-assigned this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
goal:client support Needed to support a slang use case GoodFirstBug Great bug for people getting going in slang codebase kind:bug something doesn't work like it should
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants