summaryrefslogtreecommitdiff
path: root/source/slang/diagnostics.h
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-12 13:26:53 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-12 13:26:53 -0700
commit0174470593881b5fe6c22594c9df875ab95a6735 (patch)
tree3bc9146ef6375c2f5055aa0db995e7a403afe931 /source/slang/diagnostics.h
parent11f12cd3a1d53f988d4c9726ac4301f35dc7f01f (diff)
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
Diffstat (limited to 'source/slang/diagnostics.h')
-rw-r--r--source/slang/diagnostics.h6
1 files changed, 6 insertions, 0 deletions
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