From 21c3cc8a0a32f277df95be45abcc46642b906207 Mon Sep 17 00:00:00 2001 From: Alexey Panteleev Date: Mon, 16 May 2022 06:57:49 -0700 Subject: Fixed the false successful compile result when the FXC downstream compiler is called with invalid arguments, such as unsupported profile. (#2235) --- source/compiler-core/slang-fxc-compiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source') diff --git a/source/compiler-core/slang-fxc-compiler.cpp b/source/compiler-core/slang-fxc-compiler.cpp index 62113a629..2e78f8aa4 100644 --- a/source/compiler-core/slang-fxc-compiler.cpp +++ b/source/compiler-core/slang-fxc-compiler.cpp @@ -299,6 +299,12 @@ SlangResult FXCDownstreamCompiler::compile(const CompileOptions& options, RefPtr SLANG_ASSERT(SLANG_SUCCEEDED(diagnosticParseRes)); } + // If FXC failed, make sure we have an error in the diagnostics + if (FAILED(hr)) + { + diagnostics.requireErrorDiagnostic(); + } + // ID3DBlob is compatible with ISlangBlob, so just cast away... ISlangBlob* slangCodeBlob = (ISlangBlob*)codeBlob.get(); -- cgit v1.2.3