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. --- tools/render-test/render-test-main.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tools/render-test') 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()); } -- cgit v1.2.3