commit | 4d1d143977dd4272dc61eb7c3f6fc96f539f77f8 | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Mon Jul 25 23:37:34 2022 +0000 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Jul 25 23:37:34 2022 +0000 |
tree | ff68a0498b98113e88a6f57349d8b94d1ae94cee | |
parent | 45db5df803cc11a73a521c68e991ec4832c248a1 [diff] |
tint/utils: More Vector polish * Added a class template argument deduction guide (CTAD) to infer the `T` and `N` template arguments. This lets you write `Vector{1,2,3}` instead of `Vector<int, 3>{1,2,3}`. This is important as a mismatch between the number of constructor arguments and the `N` template argument can cause silent heap allocations, which we're trying to avoid. The `T` deduction uses the same smarts as the return-type deduction of `Switch()`, so: * `Vector{1, 2.0}` would construct a `Vector<double, 2>` * `Vector{i32, u32}` would construct a `Vector<const sem::Type*, 2>` * Removed the Vector(size_t) and Vector(size_t, const T&) constructors. This is a move away from the std::vector style API, but these are rarely more efficient than calling Reserve() and Push(), as you remove the redundant initialization. The main reason for doing this is to remove ambiguity between `Vector{1}` and `Vector(1)`. * Added support for covariance conversion (`Vector<Derived*, N>` -> `Vector<Base*, N>`). Only supports pointers to `Castable`, as this can only safely work with single-inheritance. * Added support for conversion of `Vector<T*, N>` -> `Vector<const T*, N>`. This will remove pointless vector copies from the sem package. Bug: tint:1613 Change-Id: I79b9f82d623f90afa14f8ba1613ee49cccceafeb Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97020 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Ben Clayton <bclayton@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
Dawn is an open-source and cross-platform implementation of the work-in-progress 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)
(TODO)
Apache 2.0 Public License, please see LICENSE.
This is not an officially supported Google product.