diff options
| author | Yong He <yonghe@outlook.com> | 2024-01-22 15:19:26 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-22 15:19:26 -0800 |
| commit | fec9c42d4c61d1bdd54d020d55a3155e0d54fce7 (patch) | |
| tree | 0e1c1777cad8dfab2766c6dee9635549445df428 /source/slang/slang-ir-layout.cpp | |
| parent | c4e42ab49019bcd9f05217abe8e5d4c083622473 (diff) | |
Bug fixes for the direct spirv backend. (#3474)
* Fix GLSL legalization bug that leads to crash.
* Update diagnostic id to avoid conflict.
* Fix std140 layout logic.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-layout.cpp')
| -rw-r--r-- | source/slang/slang-ir-layout.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/slang/slang-ir-layout.cpp b/source/slang/slang-ir-layout.cpp index 79012e7ba..a6684c7b1 100644 --- a/source/slang/slang-ir-layout.cpp +++ b/source/slang/slang-ir-layout.cpp @@ -461,9 +461,10 @@ struct Std140LayoutRules : IRTypeLayoutRules } virtual IRSizeAndAlignment getVectorSizeAndAlignment(IRSizeAndAlignment element, IRIntegerValue count) { + IRIntegerValue alignmentCount = count; if (count == 3) - count = 4; - return IRSizeAndAlignment((int)(element.size * count), (int)(element.size * count)); + alignmentCount = 4; + return IRSizeAndAlignment((int)(element.size * count), (int)(element.size * alignmentCount)); } }; |
