50 : fError(DawnErrorType::kNoError)
51 , fScopeIdx(kScopeCount - 1)
52 , fWait(sharedContext) {}
53 } errorState(fSharedContext);
55 wgpu::ErrorCallback errorCallback = [](WGPUErrorType status,
const char* msg,
void* userData) {
56 ErrorState* errorState =
static_cast<ErrorState*
>(userData);
57 if (status != WGPUErrorType_NoError) {
58 SkASSERT(errorState->fScopeIdx >= 0);
59 const char* errorScopeName = kErrorScopeNames[errorState->fScopeIdx];
60 SKGPU_LOG_E(
"Failed in error scope (%s): %s", errorScopeName, msg);
61 errorState->fError |= kErrorScopeTypes[errorState->fScopeIdx];
63 errorState->fScopeIdx--;
64 errorState->fWait.signal();
69 fSharedContext->
device().PopErrorScope(errorCallback, &errorState);
70 errorState.fWait.busyWait();
71 errorState.fWait.reset();
74 fSharedContext->
device().PopErrorScope(errorCallback, &errorState);
75 errorState.fWait.busyWait();
76 errorState.fWait.reset();
79 fSharedContext->
device().PopErrorScope(errorCallback, &errorState);
80 errorState.fWait.busyWait();
83 return errorState.fError;
const wgpu::Device & device() const