diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /source/slang/slang-ir-metadata.cpp | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'source/slang/slang-ir-metadata.cpp')
| -rw-r--r-- | source/slang/slang-ir-metadata.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/source/slang/slang-ir-metadata.cpp b/source/slang/slang-ir-metadata.cpp index 030fde157..7f0c82471 100644 --- a/source/slang/slang-ir-metadata.cpp +++ b/source/slang/slang-ir-metadata.cpp @@ -1,10 +1,9 @@ // slang-ir-metadata.cpp #include "slang-ir-metadata.h" -#include "slang-ir.h" -#include "slang-ir-insts.h" - #include "../compiler-core/slang-artifact-associated-impl.h" +#include "slang-ir-insts.h" +#include "slang-ir.h" namespace Slang { @@ -14,8 +13,14 @@ namespace Slang // analysis scenarios in the future. -// Inserts a single resource binding (which takes `count` slots, where 0 means unbounded) into the list of resource ranges. -static void _insertBinding(List<ShaderBindingRange>& ranges, LayoutResourceKind kind, UInt spaceIndex, UInt registerIndex, UInt count) +// Inserts a single resource binding (which takes `count` slots, where 0 means unbounded) into the +// list of resource ranges. +static void _insertBinding( + List<ShaderBindingRange>& ranges, + LayoutResourceKind kind, + UInt spaceIndex, + UInt registerIndex, + UInt count) { // Construct a new range from the provided resource. ShaderBindingRange newRange; @@ -55,15 +60,18 @@ void collectMetadata(const IRModule* irModule, ArtifactPostEmitMetadata& outMeta } auto param = as<IRGlobalParam>(inst); - if (!param) continue; - + if (!param) + continue; + auto layoutDecoration = param->findDecoration<IRLayoutDecoration>(); - if (!layoutDecoration) continue; - + if (!layoutDecoration) + continue; + auto varLayout = as<IRVarLayout>(layoutDecoration->getLayout()); - if (!varLayout) continue; - - for(auto sizeAttr : varLayout->getTypeLayout()->getSizeAttrs()) + if (!varLayout) + continue; + + for (auto sizeAttr : varLayout->getTypeLayout()->getSizeAttrs()) { auto kind = sizeAttr->getResourceKind(); @@ -85,4 +93,4 @@ void collectMetadata(const IRModule* irModule, ArtifactPostEmitMetadata& outMeta } } -} +} // namespace Slang |
