diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/slang-ir-specialize.cpp | 6 | ||||
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 25 | ||||
| -rw-r--r-- | source/slang/slang-ir-util.h | 2 |
3 files changed, 33 insertions, 0 deletions
diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp index 2757538a6..50dfa2c6a 100644 --- a/source/slang/slang-ir-specialize.cpp +++ b/source/slang/slang-ir-specialize.cpp @@ -125,6 +125,12 @@ struct SpecializationContext } } + if (isWrapperType(inst)) + { + // For all the wrapper type, we need to make sure the operands are fully specialized. + return areAllOperandsFullySpecialized(inst); + } + // The default case is that a global value is always specialized. if (inst->getParent() == module->getModuleInst()) { diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index 7788a50d5..c753600a7 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -277,6 +277,31 @@ bool isSimpleHLSLDataType(IRInst* inst) return true; } +bool isWrapperType(IRInst* inst) +{ + switch (inst->getOp()) + { + case kIROp_ArrayType: + case kIROp_TextureType: + case kIROp_VectorType: + case kIROp_MatrixType: + case kIROp_PtrType: + case kIROp_RefType: + case kIROp_ConstRefType: + case kIROp_HLSLStructuredBufferType: + case kIROp_HLSLRWStructuredBufferType: + case kIROp_HLSLRasterizerOrderedStructuredBufferType: + case kIROp_HLSLAppendStructuredBufferType: + case kIROp_HLSLConsumeStructuredBufferType: + case kIROp_TupleType: + case kIROp_OptionalType: + case kIROp_TypePack: + return true; + default: + return false; + } +} + SourceLoc findFirstUseLoc(IRInst* inst) { for (auto use = inst->firstUse; use; use = use->nextUse) diff --git a/source/slang/slang-ir-util.h b/source/slang/slang-ir-util.h index 9a712ba96..e23aeb618 100644 --- a/source/slang/slang-ir-util.h +++ b/source/slang/slang-ir-util.h @@ -104,6 +104,8 @@ bool isSimpleDataType(IRType* type); bool isSimpleHLSLDataType(IRInst* inst); +bool isWrapperType(IRInst* inst); + SourceLoc findFirstUseLoc(IRInst* inst); inline bool isChildInstOf(IRInst* inst, IRInst* parent) |
