diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2017-06-26 12:04:54 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-26 12:04:54 -0700 |
| commit | 3f316dcbd9274efc74f817cf36f17a511ff2e21e (patch) | |
| tree | 185210d30a7887df823bb0c6d817d3feb2ebe675 /source/slang/type-layout.cpp | |
| parent | d506737b8b00bcc89adf937994ceb6df4509c98a (diff) | |
| parent | 07f9b9ec7c9be6a0eff65ef327d2a0fee262aed7 (diff) | |
Merge pull request #42 from tfoleyNV/reflect-imported
Reflect imported code
Diffstat (limited to 'source/slang/type-layout.cpp')
| -rw-r--r-- | source/slang/type-layout.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source/slang/type-layout.cpp b/source/slang/type-layout.cpp index 3427d6a6f..8b8a2b437 100644 --- a/source/slang/type-layout.cpp +++ b/source/slang/type-layout.cpp @@ -632,9 +632,20 @@ createParameterBlockTypeLayout( RefPtr<TypeLayout> elementTypeLayout, LayoutRulesImpl* rules) { - auto info = getParameterBlockLayoutInfo( - parameterBlockType, - rules); + SimpleLayoutInfo info; + if (parameterBlockType) + { + info = getParameterBlockLayoutInfo( + parameterBlockType, + rules); + } + else + { + // If there is no concrete type, then it seems like we are + // being asked to compute layout for the global scope + info = rules->GetObjectLayout(ShaderParameterKind::ConstantBuffer); + } + auto typeLayout = new ParameterBlockTypeLayout(); |
