commit | 0de95eebe58cdfa29a00d5affd749669086e9972 | [log] [tgz] |
---|---|---|
author | Kai Ninomiya <kainino@chromium.org> | Mon Mar 24 17:27:25 2025 -0700 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Mar 24 17:27:25 2025 -0700 |
tree | 419b3fe64f7c6eae2763c6005b44362a8a78ef71 | |
parent | e987e6615bf2e577a2b835c66576735b8e8eaa88 [diff] |
[native] Make mappedAtCreation always return null or a mapped buffer This is the behavior of the JS API and Dawn Wire. Make Dawn Native match, by returning nullptr IFF there was an OOM while mapping at creation. If not, the returned buffer is always mapped (which required making ErrorBuffer be able to MapAtCreation). Dawn Native still doesn't quite match the spec; calling device.Destroy() a second time won't unmap any buffers that were created mappedAtCreation *after* the first device.Destroy(). But at least the CreateBuffer invariant is upheld. Unfortunately, some possible but rare scenarios are not testable naturally. For these, the DawnFakeBufferOOMForTesting extension allows injecting simulated OOMs at different points. Working on this project found several spec issues: - https://github.com/gpuweb/gpuweb/issues/5101 (tangentially related) - https://github.com/gpuweb/gpuweb/issues/5102 - https://github.com/gpuweb/gpuweb/issues/5105 Bug: 42241190 Change-Id: If77626a0fc86c7323f776d3781a9bd764068d08b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/227397 Auto-Submit: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Kai Ninomiya <kainino@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.