summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorpdeayton-nv <205388607+pdeayton-nv@users.noreply.github.com>2025-07-15 17:44:33 -0700
committerGitHub <noreply@github.com>2025-07-16 00:44:33 +0000
commit299eb0c889322a960d1907b6722ee1caf88475a4 (patch)
treeded57d1c9fe1e8ec909722877b93cb0037bf190d /source/core
parenta8519e68b6df636932ca5d89a332b2a689259b0f (diff)
Fix GLSL memory layout qualifiers not applied to uniform buffers or cbuffers (#7740)
* Fix GLSL memory layout qualifiers not applied to uniform buffers or cbuffers The `layout(scalar)` qualifier was being ignored for GLSL `uniform` blocks and HLSL `cbuffer` declarations, causing them to use std140 layout instead of the requested scalar layout. **Root Cause**: The parsing logic in `slang-parser.cpp` handled layout qualifiers inconsistently: - GLSL `buffer` blocks correctly used `getLayoutArg()` to map layout modifiers - GLSL `uniform` blocks and HLSL `cbuffer` skipped layout arguments entirely **Solution**: - Enhanced `parseHLSLCBufferDecl()` to check for GLSL layout qualifiers - Added same `getLayoutArg()` logic used by buffer blocks - Modified uniform block parsing to pass layout arguments through **Testing**: - Added comprehensive test case: `tests/glsl/layout-scalar-qualifier.slang` - Verified fix works for both `uniform` blocks and `cbuffer` declarations - Confirmed no regressions in existing test suite **Before**: `layout(scalar) uniform {...}` → std140 layout (32 bytes, offset 0,16) **After**: `layout(scalar) uniform {...}` → scalar layout (16 bytes, offset 0,4) Fixes #7735 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: pdeayton-nv <pdeayton-nv@users.noreply.github.com> * Apply code formatting to slang-parser.cpp Fixed line wrapping, trailing whitespace, and parameter formatting according to repository style guidelines. Co-authored-by: Harsh Aggarwal (NVIDIA) <szihs@users.noreply.github.com> * format code (#7742) Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pdeayton-nv <pdeayton-nv@users.noreply.github.com> Co-authored-by: Harsh Aggarwal (NVIDIA) <szihs@users.noreply.github.com> Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/core')
0 files changed, 0 insertions, 0 deletions