[cpp] Refactors callback info handling in cpp header. - This refactor adds new utilities to unify callback info handling in the cpp header. This change only updates the methods that return a wgpu::Future, but in follow ups, we will also unify the generator to use the helpers for structs that have callback info members, i.e. the DeviceDescriptor. - The refactor also introduces the concept of CArgConverter, which will allow us to extend the C++ API to handle more types of callbacks. The extensibility of this design will allow us to manually implement conversions when they are not trivial, i.e. the DeviceLost and UncapturedError callbacks will use this in a follow up. This will also allow us to provide callbacks that are more C++ friendly, i.e. the DawnCacheDeviceDescriptor and it's callbacks could be updated to be more like the one's in the DeviceDescriptor, and in C++, we can wrap the raw pointers in those callbacks with a std::span to provide additional safety. - This change also implicitly removes support for the old char* types for messages in callbacks, and instead only supports wgpu::StringView for those. In another follow up, we could actually use the CArgConverter design to support std::string_view directly and potentially remove the wgpu::StringView type from the C++ bindings entirely. Bug: 512880446 Change-Id: I9ff6932b0dff92b41344b89a1c592495d7a60e0b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/305676 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: 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.