Add the "internal" error type

Currently only raised if Tint produces an Internal Compiler Error
(ICE). These were previously surfaced as validation errors.

Bug: dawn:1531
Change-Id: I9a10549b3e0bc2cbf962c99d157aa6dbe8032a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/101500
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This commit is contained in:
Brandon Jones 2022-09-07 14:14:14 +00:00 committed by Dawn LUCI CQ
parent d137757a63
commit 567f06849b
3 changed files with 8 additions and 4 deletions

View File

@ -1302,7 +1302,8 @@
"category": "enum", "category": "enum",
"values": [ "values": [
{"value": 0, "name": "validation"}, {"value": 0, "name": "validation"},
{"value": 1, "name": "out of memory"} {"value": 1, "name": "out of memory"},
{"value": 2, "name": "internal"}
] ]
}, },
"error type": { "error type": {
@ -1312,8 +1313,9 @@
{"value": 0, "name": "no error"}, {"value": 0, "name": "no error"},
{"value": 1, "name": "validation"}, {"value": 1, "name": "validation"},
{"value": 2, "name": "out of memory"}, {"value": 2, "name": "out of memory"},
{"value": 3, "name": "unknown"}, {"value": 3, "name": "internal"},
{"value": 4, "name": "device lost"} {"value": 4, "name": "unknown"},
{"value": 5, "name": "device lost"}
] ]
}, },
"logging type": { "logging type": {

View File

@ -28,6 +28,8 @@ wgpu::ErrorType ErrorFilterToErrorType(wgpu::ErrorFilter filter) {
return wgpu::ErrorType::Validation; return wgpu::ErrorType::Validation;
case wgpu::ErrorFilter::OutOfMemory: case wgpu::ErrorFilter::OutOfMemory:
return wgpu::ErrorType::OutOfMemory; return wgpu::ErrorType::OutOfMemory;
case wgpu::ErrorFilter::Internal:
return wgpu::ErrorType::Internal;
} }
UNREACHABLE(); UNREACHABLE();
} }

View File

@ -29,7 +29,7 @@ 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::Validation, diagnostics.str().c_str()); tlDevice->HandleError(InternalErrorType::Internal, diagnostics.str().c_str());
} }
} }