summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-lower-generic-call.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-11-16 14:32:33 -0800
committerGitHub <noreply@github.com>2023-11-16 14:32:33 -0800
commit4c78efd0c34442866f20e9d00bbb6908115c9a01 (patch)
tree03ca8584847f0937a926f6b27386dcd982ed7780 /source/slang/slang-ir-lower-generic-call.cpp
parent12f7237e4060388494c549623f4a640327b7ca08 (diff)
Unify stdlib `Texture` types into one generic type. (#3327)
* Unify Texture types in stdlib into 1 generic type. * Fixes. * Fix. * Fixes. * Fix reflection. * Fix binding reflection. * Add gather intrinsics. * Fix gather intrinsics. * Fix texture type toText. * Fix intrinsic. * fix cuda intrinsic. * Fix project files. * cleanup. * Fix. * Fix. * Fix sampler feedback test. * Fix getDimension intrinsics. * Fix spirv sample image intrinsics. * Fix test. * Fix GLSL intrinsic. * Cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-lower-generic-call.cpp')
-rw-r--r--source/slang/slang-ir-lower-generic-call.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/source/slang/slang-ir-lower-generic-call.cpp b/source/slang/slang-ir-lower-generic-call.cpp
index aaa419b2e..c312d3c88 100644
--- a/source/slang/slang-ir-lower-generic-call.cpp
+++ b/source/slang/slang-ir-lower-generic-call.cpp
@@ -239,6 +239,13 @@ namespace Slang
// If we see a call(specialize(gFunc, Targs), args),
// translate it into call(gFunc, args, Targs).
auto loweredFunc = specializeInst->getBase();
+
+ // Don't process intrinsic functions.
+ UnownedStringSlice intrinsicDef;
+ if (findTargetIntrinsicDefinition(getResolvedInstForDecorations(loweredFunc),
+ sharedContext->targetReq->getTargetCaps(), intrinsicDef))
+ return;
+
// All callees should have already been lowered in lower-generic-functions pass.
// For intrinsic generic functions, they are left as is, and we also need to ignore
// them here.
@@ -251,14 +258,6 @@ namespace Slang
// All nested generic functions are supposed to be flattend before this pass.
// If they are not, they represent an intrinsic function that should not be
// modified in this pass.
- auto innerMostFunc = findInnerMostSpecializingBase(static_cast<IRSpecialize*>(loweredFunc));
- if (innerMostFunc && innerMostFunc->getOp() == kIROp_Generic)
- {
- innerMostFunc =
- findInnerMostGenericReturnVal(static_cast<IRGeneric*>(innerMostFunc));
- }
- if (innerMostFunc->findDecoration<IRTargetIntrinsicDecoration>())
- return;
SLANG_UNEXPECTED("Nested generics specialization.");
}
else if (loweredFunc->getOp() == kIROp_LookupWitness)