From 746ee0dc5bddeea177aaf609bcc5085b46c4057c Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 11 Jun 2021 12:49:04 -0700 Subject: 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 --- source/slang/slang.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source/slang/slang.cpp') 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(); cbType->elementType = type; + cbType->declRef = getASTBuilder()->getBuiltinDeclRef( + "ConstantBuffer", makeConstArrayView(static_cast(type))); containerTypeReflection = cbType; } break; @@ -946,6 +948,8 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( { ParameterBlockType* pbType = getASTBuilder()->create(); pbType->elementType = type; + pbType->declRef = getASTBuilder()->getBuiltinDeclRef( + "ParameterBlock", makeConstArrayView(static_cast(type))); containerTypeReflection = pbType; } break; @@ -954,14 +958,14 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType( HLSLStructuredBufferType* sbType = getASTBuilder()->create(); sbType->elementType = type; + sbType->declRef = getASTBuilder()->getBuiltinDeclRef( + "HLSLStructuredBufferType", makeConstArrayView(static_cast(type))); containerTypeReflection = sbType; } break; case slang::ContainerType::UnsizedArray: { - ArrayExpressionType* arrType = getASTBuilder()->create(); - arrType->baseType = type; - arrType->arrayLength = nullptr; + ArrayExpressionType* arrType = getASTBuilder()->getArrayType(type, nullptr); containerTypeReflection = arrType; } break; -- cgit v1.2.3