diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/ast-legalize.cpp | 5 | ||||
| -rw-r--r-- | source/slang/emit.cpp | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/source/slang/ast-legalize.cpp b/source/slang/ast-legalize.cpp index 2f7814055..98a9c2573 100644 --- a/source/slang/ast-legalize.cpp +++ b/source/slang/ast-legalize.cpp @@ -2683,7 +2683,10 @@ struct LoweringVisitor String mangledName = globalVar->mangledName; SLANG_ASSERT(mangledName.Length() != 0); - return LegalExpr(createUncheckedVarRef(mangledName)); + RefPtr<Expr> varRef = createUncheckedVarRef(mangledName); + varRef->type.type = globalVar->getType()->getValueType(); + + return LegalExpr(varRef); } break; diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index e40350df8..295551639 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -1410,8 +1410,13 @@ struct EmitVisitor return true; } - // Is the expression referencing a constant buffer? - if (auto cbufferType = e->type->As<ConstantBufferType>()) + // Is the expression referencing a uniform parameter group, + // but *not* a `ParameterBlock<T>`? + if (auto parameterBlockType = e->type->As<ParameterBlockType>()) + { + return false; + } + if (auto uniformParameterGroupType = e->type->As<UniformParameterGroupType>()) { return true; } |
