diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-emit-hlsl.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir-link.cpp | 3 | ||||
| -rw-r--r-- | source/slang/slang-ir-lower-witness-lookup.cpp | 2 | ||||
| -rw-r--r-- | source/slang/slang-ir.cpp | 4 | ||||
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 12 |
5 files changed, 14 insertions, 9 deletions
diff --git a/source/slang/slang-emit-hlsl.cpp b/source/slang/slang-emit-hlsl.cpp index 76300c18b..bc6b7a159 100644 --- a/source/slang/slang-emit-hlsl.cpp +++ b/source/slang/slang-emit-hlsl.cpp @@ -926,7 +926,7 @@ void HLSLSourceEmitter::emitSimpleTypeImpl(IRType* type) } case kIROp_HitObjectType: { - m_writer->emit("HitObject"); + m_writer->emit("NvHitObject"); return; } default: break; diff --git a/source/slang/slang-ir-link.cpp b/source/slang/slang-ir-link.cpp index 14e79560e..f57919e44 100644 --- a/source/slang/slang-ir-link.cpp +++ b/source/slang/slang-ir-link.cpp @@ -1198,10 +1198,11 @@ IRInst* cloneInst( IRInst* clonedArg = cloneValue(context, originalArg); newArgs[aa] = clonedArg; } + auto funcType = cloneType(context, originalInst->getFullType()); context->builder = oldBuilder; IRInst* clonedInst = builder->createIntrinsicInst( - cloneType(context, originalInst->getFullType()), + funcType, originalInst->getOp(), argCount, newArgs.getArrayView().getBuffer()); builder->addInst(clonedInst); diff --git a/source/slang/slang-ir-lower-witness-lookup.cpp b/source/slang/slang-ir-lower-witness-lookup.cpp index 841617ac8..b94059238 100644 --- a/source/slang/slang-ir-lower-witness-lookup.cpp +++ b/source/slang/slang-ir-lower-witness-lookup.cpp @@ -106,7 +106,7 @@ struct WitnessLookupLoweringContext translatedOperands.add(translateType(builder, type->getOperand(i))); } auto translated = builder.emitIntrinsicInst( - builder.getTypeKind(), + type->getFullType(), type->getOp(), (UInt)translatedOperands.getCount(), translatedOperands.getBuffer()); diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp index 74679de96..84730c913 100644 --- a/source/slang/slang-ir.cpp +++ b/source/slang/slang-ir.cpp @@ -1570,6 +1570,10 @@ namespace Slang parent = mergeCandidateParentsForHoistableInst(parent, operandParent); } + if (inst->getFullType()) + { + parent = mergeCandidateParentsForHoistableInst(parent, inst->getFullType()->getParent()); + } // We better have ended up with a parent to insert into, // or else the invariants of our IR have been violated. diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index cf564605c..7b649ff0d 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -8577,6 +8577,12 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> else outerGeneric = emitOuterGenerics(subContext, decl, decl); + FuncDeclBaseTypeInfo info; + _lowerFuncDeclBaseTypeInfo( + subContext, + createDefaultSpecializedDeclRef(context, nullptr, decl), + info); + // need to create an IR function here IRFunc* irFunc = subBuilder->createFunc(); @@ -8598,12 +8604,6 @@ struct DeclLoweringVisitor : DeclVisitor<DeclLoweringVisitor, LoweredValInfo> } } - FuncDeclBaseTypeInfo info; - _lowerFuncDeclBaseTypeInfo( - subContext, - createDefaultSpecializedDeclRef(context, nullptr, decl), - info); - auto irFuncType = info.type; auto& irResultType = info.resultType; auto& parameterLists = info.parameterLists; |
