dawn/native: Hook tint ICE up to Dawn assertions

Scream and shout if we ICE in a debug build.

Fixed: tint:597
Change-Id: Ie349d314a2ddf518f54df81469e4e14aa16cacda
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/114540
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2023-01-03 21:45:05 +00:00 committed by Dawn LUCI CQ
parent 4cef4362b0
commit b70d610bae
1 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,15 @@ thread_local DeviceBase* tlDevice = nullptr;
void TintICEReporter(const tint::diag::List& diagnostics) { void TintICEReporter(const tint::diag::List& diagnostics) {
if (tlDevice) { if (tlDevice) {
tlDevice->HandleError(InternalErrorType::Internal, diagnostics.str().c_str()); tlDevice->HandleError(InternalErrorType::Internal, diagnostics.str().c_str());
#if DAWN_ENABLE_ASSERTS
for (const tint::diag::Diagnostic& diag : diagnostics) {
if (diag.severity >= tint::diag::Severity::InternalCompilerError) {
HandleAssertionFailure(
diag.source.file ? diag.source.file->path.c_str() : "<unknown>", "",
diag.source.range.begin.line, diag.message.c_str());
}
}
#endif
} }
} }