summaryrefslogtreecommitdiffstats
path: root/tools/render-test
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-11-02 09:47:35 -0400
committerGitHub <noreply@github.com>2022-11-02 09:47:35 -0400
commitfb29bd32cc3404455ff92916a91c517823f486dd (patch)
tree8d847489dc2e9a46c73c01c4c4a8fc79930c75a0 /tools/render-test
parent487855ecb46ec4360464d2f028cedf8c24a66d29 (diff)
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.
Diffstat (limited to 'tools/render-test')
-rw-r--r--tools/render-test/render-test-main.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp
index c361e6b34..16b47a001 100644
--- a/tools/render-test/render-test-main.cpp
+++ b/tools/render-test/render-test-main.cpp
@@ -1074,22 +1074,20 @@ static SlangResult _setSessionPrelude(const Options& options, const char* exePat
// Let's see if we need to set up special prelude for HLSL
if (options.nvapiExtnSlot.getLength())
{
+ // We want to set the path to NVAPI
String rootPath;
SLANG_RETURN_ON_FAIL(TestToolUtil::getRootPath(exePath, rootPath));
-
String includePath;
- if (TestToolUtil::getIncludePath(rootPath, "external/nvapi/nvHLSLExtns.h", includePath) !=
- SLANG_OK)
- {
- return SLANG_FAIL;
- }
+ SLANG_RETURN_ON_FAIL(TestToolUtil::getIncludePath(rootPath, "external/nvapi/nvHLSLExtns.h", includePath))
StringBuilder buf;
// We have to choose a slot that NVAPI will use.
buf << "#define NV_SHADER_EXTN_SLOT " << options.nvapiExtnSlot << "\n";
// Include the NVAPI header
- buf << "#include \"" << includePath << "\"\n\n";
+ buf << "#include ";
+ StringEscapeUtil::appendQuoted(StringEscapeUtil::getHandler(StringEscapeUtil::Style::Cpp), includePath.getUnownedSlice(), buf);
+ buf << "\n\n";
session->setLanguagePrelude(SLANG_SOURCE_LANGUAGE_HLSL, buf.getBuffer());
}