summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-09-13 13:11:48 -0700
committerGitHub <noreply@github.com>2022-09-13 13:11:48 -0700
commitf216b77752b9e4aea52882b2110ceb1cc64a2171 (patch)
treefbb33485b7260bc0f89b406e1be6fb8196f94196 /source/slang/slang.cpp
parent9f3e83cf0d664c87a618edf08d834829178030e6 (diff)
Deduplicate AST type nodes and cache lookup operations. (#2397)
* wip: dedup AST type nodes and cache lookup. * Fix. * Remove profiling. * Fixes. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index a0355c266..b68dbc14a 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -1178,7 +1178,7 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType(
ConstantBufferType* cbType = getASTBuilder()->create<ConstantBufferType>();
cbType->elementType = type;
cbType->declRef = getASTBuilder()->getBuiltinDeclRef(
- "ConstantBuffer", makeConstArrayViewSingle<Val*>(static_cast<Val*>(type)));
+ "ConstantBuffer", static_cast<Val*>(type));
containerTypeReflection = cbType;
}
break;
@@ -1187,7 +1187,7 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType(
ParameterBlockType* pbType = getASTBuilder()->create<ParameterBlockType>();
pbType->elementType = type;
pbType->declRef = getASTBuilder()->getBuiltinDeclRef(
- "ParameterBlock", makeConstArrayViewSingle<Val*>(static_cast<Val*>(type)));
+ "ParameterBlock", static_cast<Val*>(type));
containerTypeReflection = pbType;
}
break;
@@ -1197,7 +1197,7 @@ SLANG_NO_THROW slang::TypeReflection* SLANG_MCALL Linkage::getContainerType(
getASTBuilder()->create<HLSLStructuredBufferType>();
sbType->elementType = type;
sbType->declRef = getASTBuilder()->getBuiltinDeclRef(
- "HLSLStructuredBufferType", makeConstArrayViewSingle<Val*>(static_cast<Val*>(type)));
+ "HLSLStructuredBufferType", static_cast<Val*>(type));
containerTypeReflection = sbType;
}
break;
@@ -3839,7 +3839,7 @@ struct SpecializationArgModuleCollector : ComponentTypeVisitor
{
if(auto genericSubst = as<GenericSubstitution>(substitution))
{
- for(auto arg : genericSubst->args)
+ for(auto arg : genericSubst->getArgs())
{
collectReferencedModules(arg);
}