From 3e312b3062ab493c80d7d7eddf43c94ec59ecdb7 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 10 Nov 2022 18:38:19 -0500 Subject: Improvements to NVRTC diagnostic parsing (#2504) * #include an absolute path didn't work - because paths were taken to always be relative. * Float16 support for C++/CPU based targets with f16tof32 and f32tof16. * Small correction around INF/NAN handling for f32tof16 * Small improvement to f16tof32 * Disable CUDA test for now. * Improvements to NVRTC diagnostic parsing. Handle compilerSpecificArgs. Fix issue with terminating nul ending up in diagnostic string. * Improved NVRTC error parsing. f32tof16 and f16tof32 work in principal on CUDA. * Small update to test, although they remain disabled. * Work around SLANG_E_NOT_AVAILABLE being turned into ignored, when a legitimate error is found * A more tightly constrained fallback NVRTC diagnostic parsing. * Remove CharUtil, as not neeed. Co-authored-by: Yong He --- tools/render-test/render-test-main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tools/render-test/render-test-main.cpp') diff --git a/tools/render-test/render-test-main.cpp b/tools/render-test/render-test-main.cpp index 805f08d10..d3c284132 100644 --- a/tools/render-test/render-test-main.cpp +++ b/tools/render-test/render-test-main.cpp @@ -510,7 +510,16 @@ SlangResult RenderTestApp::initialize( // ComPtr outDiagnostics; auto result = device->createProgram(m_compilationOutput.output.desc, m_shaderProgram.writeRef(), outDiagnostics.writeRef()); - SLANG_RETURN_ON_FAIL(result); + + // If there was a failure creating a program, we can't continue + // Special case SLANG_E_NOT_AVAILABLE error code to make it a failure, + // as it is also used to indicate an attempt setup something failed gracefully (because it couldn't be supported) + // but that's not this. + if (SLANG_FAILED(result)) + { + result = (result == SLANG_E_NOT_AVAILABLE) ? SLANG_FAIL : result; + return result; + } m_device = device; -- cgit v1.2.3