From 818f07558c44c3b7f5618460d20c1374df2f1262 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 7 Sep 2023 16:37:55 -0700 Subject: Fix GLSL output for `gl_ClipDistance` input builtin. (#3193) * Fix GLSL output for `gl_ClipDistance` input builtin. * Fix. --------- Co-authored-by: Yong He --- source/slang/slang.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index ae008cebb..38ebcccd6 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -5287,11 +5287,17 @@ SlangResult EndToEndCompileRequest::EndToEndCompileRequest::compile() { res = executeActions(); } - catch (const AbortCompilationException&) + catch (const AbortCompilationException& e) { // This situation indicates a fatal (but not necessarily internal) error // that forced compilation to terminate. There should already have been // a diagnostic produced, so we don't need to add one here. + if (getSink()->getErrorCount() == 0) + { + // If for some reason we didn't output any diagnostic, something is + // going wrong, but we want to make sure we at least output something. + getSink()->diagnose(SourceLoc(), Diagnostics::compilationAbortedDueToException, typeid(e).name(), e.Message); + } } catch (const Exception& e) { -- cgit v1.2.3