KhronosGroup / KhronosGroup/glslang
Defining offset in layout for push constant uniform doesn't set the offset
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 989
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 31
Description
The following code is valid:
`layout (push_constant) uniform pushConstants {
layout(offset = 64) uint texIndex;
} push;`
While this code is not:
`layout (push_constant, offset = 64) uniform pushConstants {
uint texIndex;
} push;`
The offset will remain as 0 if you define the offset alongside the push constant uniform's layout rather than defining a new layout for the first member of the uniform.
Contributor guide
Research direction
Reproduce the issue with the two push-constant uniform snippets and trace how layout qualifiers are handled by the compiler. No source files or tests are named in the report; done means the uniform-level offset is honored as 64 rather than remaining 0, with a regression test covering the syntax.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100