Support WGPUStringView in non-struct input arguments - Add WGPUStringView struct. In C++ there is both wgpu::StringView and wgpu::NullableStringView to differentiate different types of strings. These structs appear identically in C. - Add support for serializing / deserializing WGPUStringView in the wire, with tests. - Update methods with input args to take WGPUStringView in addition to the legacy const char* path. Methods with WGPUStringView are suffixed with "2", but overloaded without the suffix in the C++ API. - wgpu::StringView may be implicitly constructed from std::string_view, const char* to ease use in C++. Add tests for these constructors. wgpu::NullableStringView may be constructed from nullptr and std::nullopt - Add tests for passing wgpu::StringView or passing it via implicit conversion into the API. - WGPUStringView is passed into Dawn as std::string_view or as a std::optional<std::string_view> depending on whether the arg is nullable or not. This simplifies usage in Dawn and makes it more type safe. Bug: 42241188 Change-Id: Ia3dc6ef5d55f382dc8d132d3f997bb84c08cda5b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/198795 Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@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.