From ce879112cb16e3def1b8673104e7123b8b17ee2a Mon Sep 17 00:00:00 2001 From: Yong He Date: Sun, 21 Jan 2018 07:09:55 -0500 Subject: Improvements and bug fixes for global type parameters 1. allow spReflection_FindTypeByName to accept arbitrary type expression string 2. allow const int generic value to be used as expression value, and as array size 3. various bug fixes in witness table specialization / function cloning during specializeIRForEntryPoint to avoid creating duplicate global values, not copying the right definition of a function from the other module, not cloning witness tables that are required by specializeGenerics etc. --- source/slang/syntax.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/syntax.cpp') diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index 85a702726..ab4a5f94c 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -362,12 +362,14 @@ void Type::accept(IValVisitor* visitor, void* extra) { int diff = 0; auto elementType = baseType->SubstituteImpl(subst, &diff).As(); + auto arrlen = ArrayLength->SubstituteImpl(subst, &diff).As(); + SLANG_ASSERT(arrlen); if (diff) { *ioDiff = 1; auto rsType = getArrayType( elementType, - ArrayLength); + arrlen); return rsType; } return this; -- cgit v1.2.3