From dafe651ecf21f2dce7f156179af785adca08ced0 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 28 Sep 2022 13:30:37 -0400 Subject: Improvements around diagnostic controls (#2414) * #include an absolute path didn't work - because paths were taken to always be relative. * Test for disabling warnings. * Output diagnostic if argument parsing fails in render test. * More improvements around disabling diagnostics. * Add support for re enabling a warning. * Add warning controls to help text. * Tidy up around NameConventionUtil. * Make NameConvention an enum. * Handle leading underscores. * Update comment, and remove intial handling of _ prefix. --- tools/render-test/slang-support.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tools/render-test') diff --git a/tools/render-test/slang-support.cpp b/tools/render-test/slang-support.cpp index ed7bb752e..5b2d69bf4 100644 --- a/tools/render-test/slang-support.cpp +++ b/tools/render-test/slang-support.cpp @@ -85,9 +85,20 @@ void ShaderCompilerUtil::Output::reset() args.add(arg.value.getBuffer()); } + // If there are additional args parse them if (args.getCount()) { - SLANG_RETURN_ON_FAIL(spProcessCommandLineArguments(slangRequest, args.getBuffer(), int(args.getCount()))); + const auto res = slangRequest->processCommandLineArguments(args.getBuffer(), int(args.getCount())); + + // If there is a parse failure and diagnostic, output it + if (SLANG_FAILED(res)) + { + if (auto diagnostics = slangRequest->getDiagnosticOutput()) + { + fprintf(stderr, "%s", diagnostics); + } + return res; + } } } -- cgit v1.2.3