commit | e4ce129bae0013a0ef7b5c9c45ff117a53277b91 | [log] [tgz] |
---|---|---|
author | Corentin Wallez <cwallez@chromium.org> | Mon Oct 14 15:58:25 2024 +0000 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Oct 14 15:58:25 2024 +0000 |
tree | e28a15c9b394e915a09c846a6d185b704069f7e6 | |
parent | 2ea6fcecf35bf75cf2cb9044f1d53d0fb9c5a47a [diff] |
[dawn][webgpu.h] Use StringView in callback arguments. This changes all callback const char* arguments to StringView instead. To allow a semi-graceful deprecation, the webgpu_cpp.h template is changed to temporarily support passing callbacks with const char* by copying the StringView to a null-terminated allocation internally. A lot of places in the code didn't use the C++ callbacks and need to be updated though (in this repo, or in other repos with the breaking change define). Changes are: - Updates to dawn.json to update all callbacks to use StringView. - The addition of a breaking change define. - Updates to api_cpp.h to support const char* callbacks temporarily: - This required moving StringView up in the header, so it is now fully manually written instead of being partially generated. - For consistency api_structs.cpp/.h does the same. - dawn::native and dawn::wire are updated to pass sized string views instead of C strings to callbacks. - Small updates are done to mock_api, dawn.node, DawnWireServerFuzzer, samples and test harnesses when the C callbacks are used. - Tests are updated when they used the C API: - A new header is added that contains GMock matchers for WGPUStringView to make it easy to do StrEq equivalents etc, but also that check that strings are sized (as required by webgpu.h semantics). Bug: 42241188 Change-Id: I3d04bfb3b80fd89773e74a04d2aef6ff161ec8f7 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/209098 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
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.