diff options
| author | Yong He <yonghe@outlook.com> | 2021-06-11 12:49:04 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-11 12:49:04 -0700 |
| commit | 746ee0dc5bddeea177aaf609bcc5085b46c4057c (patch) | |
| tree | 699e24ca1c1d6889afed9c6e0b1418d637603df9 /source/slang/slang.cpp | |
| parent | 37e8917d10626b519470f2e34625f0efe741352f (diff) | |
Properly fill `declref` in `Linkage::getContainerType`. (#1882)
* Properly fill `declref` in `Linkage::getContainerType`.
* Fix timestamp query on cpu
* Fix typo.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index f8af39fcb..eed172bbf 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -939,6 +939,8 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( { ConstantBufferType* cbType = getASTBuilder()->create<ConstantBufferType>(); cbType->elementType = type; + cbType->declRef = getASTBuilder()->getBuiltinDeclRef( + "ConstantBuffer", makeConstArrayView<Val*>(static_cast<Val*>(type))); containerTypeReflection = cbType; } break; @@ -946,6 +948,8 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( { ParameterBlockType* pbType = getASTBuilder()->create<ParameterBlockType>(); pbType->elementType = type; + pbType->declRef = getASTBuilder()->getBuiltinDeclRef( + "ParameterBlock", makeConstArrayView<Val*>(static_cast<Val*>(type))); containerTypeReflection = pbType; } break; @@ -954,14 +958,14 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( HLSLStructuredBufferType* sbType = getASTBuilder()->create<HLSLStructuredBufferType>(); sbType->elementType = type; + sbType->declRef = getASTBuilder()->getBuiltinDeclRef( + "HLSLStructuredBufferType", makeConstArrayView<Val*>(static_cast<Val*>(type))); containerTypeReflection = sbType; } break; case slang::ContainerType::UnsizedArray: { - ArrayExpressionType* arrType = getASTBuilder()->create<ArrayExpressionType>(); - arrType->baseType = type; - arrType->arrayLength = nullptr; + ArrayExpressionType* arrType = getASTBuilder()->getArrayType(type, nullptr); containerTypeReflection = arrType; } break; |
