summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-03-26 16:39:51 -0700
committerGitHub <noreply@github.com>2023-03-26 16:39:51 -0700
commitffa7d05e898492aa1120f8747332a72ca5befc56 (patch)
tree753000a0a927a4eb046f832aeca2313a207c9ac3
parentd64ee86a3130f8eeb75d09193c38c621d7565eba (diff)
Update slang-llvm (#2735)
-rw-r--r--deps/target-deps.json10
-rw-r--r--prelude/slang-cuda-prelude.h2
-rw-r--r--source/slangc/main.cpp13
3 files changed, 17 insertions, 8 deletions
diff --git a/deps/target-deps.json b/deps/target-deps.json
index b8edc8006..e5b28eba3 100644
--- a/deps/target-deps.json
+++ b/deps/target-deps.json
@@ -4,14 +4,14 @@
"dependencies" : [
{
"name" : "slang-llvm",
- "baseUrl" : "https://github.com/shader-slang/slang-llvm/releases/download/v13.x-33/",
+ "baseUrl" : "https://github.com/shader-slang/slang-llvm/releases/download/v13.x-35/",
"optional" : true,
"packages" :
{
- "windows-x86_64" : { "type" : "url", "path" : "slang-llvm-13.x-33-win64.zip" },
- "windows-x86" : { "type": "url", "path" : "slang-llvm-13.x-33-win32.zip" },
- "linux-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-33-linux-x86_64-release.zip" },
- "macosx-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-33-macosx-x86_64-release.zip" }
+ "windows-x86_64" : { "type" : "url", "path" : "slang-llvm-13.x-35-win64.zip" },
+ "windows-x86" : { "type": "url", "path" : "slang-llvm-13.x-35-win32.zip" },
+ "linux-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-35-linux-x86_64-release.zip" },
+ "macosx-x86_64" : { "type": "url", "path" : "slang-llvm-v13.x-35-macosx-x86_64-release.zip" }
}
},
{
diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h
index 9a55aed57..240dfb3e7 100644
--- a/prelude/slang-cuda-prelude.h
+++ b/prelude/slang-cuda-prelude.h
@@ -6,8 +6,6 @@
#define SLANG_CUDA_RTC 0
#endif
-#include <stdio.h>
-
// Define SLANG_CUDA_ENABLE_HALF to use the cuda_fp16 include to add half support.
// For this to work NVRTC needs to have the path to the CUDA SDK.
//
diff --git a/source/slangc/main.cpp b/source/slangc/main.cpp
index 2fe9d19a1..3a01c07e7 100644
--- a/source/slangc/main.cpp
+++ b/source/slangc/main.cpp
@@ -66,6 +66,16 @@ static SlangResult _compile(SlangCompileRequest* compileRequest, int argc, const
return res;
}
+bool shouldEmbedPrelude(const char* const* argv, int argc)
+{
+ for (int i = 0; i < argc; i++)
+ {
+ if (UnownedStringSlice(argv[i]) == "-embed-prelude")
+ return true;
+ }
+ return false;
+}
+
SLANG_TEST_TOOL_API SlangResult innerMain(StdWriters* stdWriters, slang::IGlobalSession* sharedSession, int argc, const char*const* argv)
{
StdWriters::setSingleton(stdWriters);
@@ -86,7 +96,8 @@ SLANG_TEST_TOOL_API SlangResult innerMain(StdWriters* stdWriters, slang::IGlobal
SLANG_RETURN_ON_FAIL(slang_createGlobalSession(SLANG_API_VERSION, session.writeRef()));
}
- TestToolUtil::setSessionDefaultPreludeFromExePath(argv[0], session);
+ if (!shouldEmbedPrelude(argv, argc))
+ TestToolUtil::setSessionDefaultPreludeFromExePath(argv[0], session);
SlangCompileRequest* compileRequest = spCreateCompileRequest(session);
compileRequest->addSearchPath(Path::getParentDirectory(Path::getExecutablePath()).getBuffer());