diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2025-01-08 00:25:32 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-07 22:25:32 -0800 |
| commit | 1a56f58fdd0c704e6dc0fad0f0ec33a25a35e60b (patch) | |
| tree | a44cdcd19379df09bdd4a8e585652e718f402ac6 /source/slang/slang-ir-util.cpp | |
| parent | 7e278c3ad6eaedbce1d6b6babecbe32f1764b269 (diff) | |
Check whether array element is fully specialized (#6000)
* Check whether array element is fully specialized
close #5776
When we start specialize a "specialize" IR, we should
make sure all the elements are fully specialized, but
we miss checking the elements of an array. This change
will check the it.
* add test
* add all wrapper types into the check
* add utility function to check if the type is wrapper type
---------
Co-authored-by: zhangkai <zhangkai@zhangkais-MacBook-Pro.local>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
| -rw-r--r-- | source/slang/slang-ir-util.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
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) |
