From b92a75db2aab1adffe08ae0103cafb080f9795e2 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 14 Feb 2023 16:21:07 -0500 Subject: Preliminary debugBreak support (#2647) * #include an absolute path didn't work - because paths were taken to always be relative. * Preliminary support for debug break. * Add C++ debug break support. Add details about usage. * Improve debug break test details. * Make HLSL output a comment about no support. * Handle specialize for target assert, without a body if it has spv_instruction/target intrinsic --- source/slang/slang-check-decl.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-check-decl.cpp') 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(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() || + funcDecl->findModifier()); + } } Name* targetName = specializedModifier->targetToken.getName(); -- cgit v1.2.3