From fb29bd32cc3404455ff92916a91c517823f486dd Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 2 Nov 2022 09:47:35 -0400 Subject: Shader Execution Reordering (via NVAPI) (#2484) * #include an absolute path didn't work - because paths were taken to always be relative. * Preliminary SER NVAPI support. * Set the DXC compiler version. Fix typo in premake5.lua * Improve DXC version detection. Enable HLSL2021 on late enough version of DXC. * Fix typo. * Fix launch. * Test via DXIL output. * Update dxc-error output. --- source/slang/slang-emit-c-like.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index dcd25419e..09a18a31c 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -1472,20 +1472,31 @@ IRTargetIntrinsicDecoration* CLikeSourceEmitter::findBestTargetIntrinsicDecorati /* static */bool CLikeSourceEmitter::isOrdinaryName(UnownedStringSlice const& name) { char const* cursor = name.begin(); - char const* end = name.end(); + char const*const end = name.end(); // Consume an optional `.` at the start, which indicates // the ordinary name is for a member function. - if(cursor != end && *cursor == '.') + if(cursor < end && *cursor == '.') cursor++; - while(cursor != end) + // Must have at least one char, and first char can't be a digit + if (cursor >= end || CharUtil::isDigit(cursor[0])) + return false; + + for(; cursor < end; ++cursor) { - int c = *cursor++; - if( (c >= 'a') && (c <= 'z') ) continue; - if( (c >= 'A') && (c <= 'Z') ) continue; - if( (c >= '0') && (c <= '9') ) continue; - if( c == '_' ) continue; + const auto c = *cursor; + if (CharUtil::isAlphaOrDigit(c) || c == '_') + { + continue; + } + + // We allow :: for scope + if (c == ':' && cursor + 1 < end && cursor[1] == ':') + { + ++cursor; + continue; + } return false; } -- cgit v1.2.3