KhronosGroup / KhronosGroup/glslang

Defining offset in layout for push constant uniform doesn't set the offset

Open
#3,841 3 comments 0 reactions 0 assignees View on GitHub
bug GLSL/ESSL
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.