diff options
| author | Darren Wihandi <65404740+fairywreath@users.noreply.github.com> | 2025-04-21 12:46:23 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-21 18:46:23 +0000 |
| commit | 62baf92a524a5b57eb465100a5e47c489c049f15 (patch) | |
| tree | 8f66cd150c1e0f80bf8029ffd48bb8ba6537ff9a /source/slang/slang-ir-layout.cpp | |
| parent | 5d41a4dbd319c3266b21eee06bb6459adb59c2e7 (diff) | |
Add `vk::offset` to specify member offsets for push constants (#6797)
* Add struct member offset qualifier for SPIRV
* Implement for GLSL target and add tests
* clean up
* fix formatting
* fix typo
* renamed GLSLStructOffset to VkStructOffset and added emit-spirv-via-glsl test case
Diffstat (limited to 'source/slang/slang-ir-layout.cpp')
| -rw-r--r-- | source/slang/slang-ir-layout.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/slang/slang-ir-layout.cpp b/source/slang/slang-ir-layout.cpp index ec5389f56..df643a3c1 100644 --- a/source/slang/slang-ir-layout.cpp +++ b/source/slang/slang-ir-layout.cpp @@ -159,6 +159,12 @@ static Result _calcSizeAndAlignment( // subsequent offsets SLANG_ASSERT(!seenFinalUnsizedArrayField); + if (auto offsetDecor = + field->getKey()->findDecoration<IRVkStructOffsetDecoration>()) + { + offset = offsetDecor->getOffset()->getValue(); + } + IRSizeAndAlignment fieldTypeLayout; SLANG_RETURN_ON_FAIL( getSizeAndAlignment(optionSet, rules, field->getFieldType(), &fieldTypeLayout)); |
