summaryrefslogtreecommitdiff
path: root/source/slang/slang-lower-to-ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
-rw-r--r--source/slang/slang-lower-to-ir.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp
index a78110a84..2bf5f1e96 100644
--- a/source/slang/slang-lower-to-ir.cpp
+++ b/source/slang/slang-lower-to-ir.cpp
@@ -8823,7 +8823,7 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
IRGenContext* subContext,
GenericTypeConstraintDecl* constraintDecl)
{
- auto supType = lowerType(context, constraintDecl->sup.type);
+ auto supType = lowerType(subContext, constraintDecl->sup.type);
auto value = emitGenericConstraintValue(subContext, constraintDecl, supType);
subContext->setValue(constraintDecl, LoweredValInfo::simple(value));
}
@@ -8972,9 +8972,11 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
auto operand = value->getOperand(i);
markInstsToClone(valuesToClone, parentBlock, operand);
}
+ if (value->getFullType())
+ markInstsToClone(valuesToClone, parentBlock, value->getFullType());
+ for (auto child : value->getDecorationsAndChildren())
+ markInstsToClone(valuesToClone, parentBlock, child);
}
- for (auto child : value->getChildren())
- markInstsToClone(valuesToClone, parentBlock, child);
auto parent = parentBlock->getParent();
while (parent && parent != parentBlock)
{
@@ -9025,7 +9027,8 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo>
markInstsToClone(valuesToClone, parentGeneric->getFirstBlock(), returnType);
// For Function Types, we always clone all generic parameters regardless of whether
// the generic parameter appears in the function signature or not.
- if (returnType->getOp() == kIROp_FuncType)
+ if (returnType->getOp() == kIROp_FuncType ||
+ returnType->getOp() == kIROp_Generic)
{
for (auto genericParam : parentGeneric->getParams())
{