summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 7e8e94d95..837dcb8eb 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -5372,7 +5372,15 @@ namespace Slang
// If it's specialized for target it should have a body...
if (auto funcDecl = as<FunctionDeclBase>(decl))
{
- SLANG_ASSERT(funcDecl->body);
+ // Normally if we have specialization for target it must have a body.
+ if (funcDecl->body == nullptr)
+ {
+ // If it doesn't have a body but does have a target intrinsic/SPIRVInstructionOp
+ // it's probably ok
+
+ SLANG_ASSERT(funcDecl->findModifier<SPIRVInstructionOpAttribute>() ||
+ funcDecl->findModifier<TargetIntrinsicModifier>());
+ }
}
Name* targetName = specializedModifier->targetToken.getName();