From 0174470593881b5fe6c22594c9df875ab95a6735 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 12 Jul 2017 13:26:53 -0700 Subject: Properly register error on downstream compiler failure - The old code was just doing `exit(1)` if glslang or `D3DCompile` failed, which is obviously unacceptable - The new approach adds the output to the diagnostic buffer (or invokes the callback), and tracks the error count just like any other errors --- source/slang/diagnostics.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/diagnostics.h') diff --git a/source/slang/diagnostics.h b/source/slang/diagnostics.h index 8834f1a6e..6957fc763 100644 --- a/source/slang/diagnostics.h +++ b/source/slang/diagnostics.h @@ -185,6 +185,12 @@ namespace Slang } void diagnoseImpl(CodePosition const& pos, DiagnosticInfo const& info, int argCount, DiagnosticArg const* const* args); + + // Add a diagnostic with raw text + // (used when we get errors from a downstream compiler) + void diagnoseRaw( + Severity severity, + char const* message); }; namespace Diagnostics -- cgit v1.2.3