Refactor DeviceBase::APIPopErrorScope to avoid warning
In dawn-node, on linux, the compiler wrongly flags this piece
of code with the following warning
```
[1/3] Building CXX object src/dawn/native/CMakeFiles/dawn_native_objects.dir/Device.cpp.o
In file included from /usr/local/google/home/gman/src/node-webgpu/third_party/dawn/src/dawn/native/Device.h:31,
from /usr/local/google/home/gman/src/node-webgpu/third_party/dawn/src/dawn/native/Device.cpp:28:
In member function ‘_Tp std::atomic<_Tp>::load(std::memory_order) const [with _Tp = dawn::native::AsyncTaskState]’,
inlined from ‘std::atomic<_Tp>::operator _Tp() const [with _Tp = dawn::native::AsyncTaskState]’ at /usr/include/c++/15/atomic:253:20,
inlined from ‘dawn::native::AsyncTaskState dawn::native::AsyncTask::GetState() const’ at /usr/local/google/home/gman/src/node-webgpu/third_party/dawn/src/dawn/native/AsyncTask.h:71:46,
inlined from ‘virtual void dawn::native::DeviceBase::APIPopErrorScope(const WGPUPopErrorScopeCallbackInfo&)::PopErrorScopeEvent::Complete(dawn::EventCompletionType)’ at /usr/local/google/home/gman/src/node-webgpu/third_party/dawn/src/dawn/native/Device.cpp:947:44:
/usr/include/c++/15/atomic:308:22: warning: ‘unsigned char __atomic_load_1(const volatile void*, int)’ writing 1 byte into a region of size 0 overflows the destination [-Wstringop-overflow=]
308 | __atomic_load(std::__addressof(_M_i), __ptr, int(__m));
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In member function ‘virtual void dawn::native::DeviceBase::APIPopErrorScope(const WGPUPopErrorScopeCallbackInfo&)::PopErrorScopeEvent::Complete(dawn::EventCompletionType)’:
cc1plus: note: destination object is likely at address zero
```
This refactor avoids the warning and is maybe a tiny bit more efficient.
Change-Id: I46e6efae9fad1570a27ce24eb471a2db1d8d247d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/297497
Commit-Queue: Gregg Tavares <gman@chromium.org>
Auto-Submit: Gregg Tavares <gman@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h version that Dawn implements.webgpu.h.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.