commit | 8c55820034cee5d7146587f35ab04c9456308244 | [log] [tgz] |
---|---|---|
author | Lokbondo Kung <lokokung@google.com> | Mon Jun 23 14:32:58 2025 -0700 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Jun 23 14:32:58 2025 -0700 |
tree | 601eb75d8eee4051d945f67f39eed1d6bb5b5d07 | |
parent | 676d919522185dec21d2471fc9a8d3fd32894176 [diff] |
[dawn][native] Updates buffer mapping w.r.t device lock. The crux of this change is to make it such that users can re-entrantly use *MappedRange functions and Unmap inside of the MapAsync callback if the callback is successful. If the callback was not successful, re-entrant API usage is not allowed. - Renames GetMappedPointer->GetMappedPointerImpl for the frontend class, and then implements GetMappedPointer to take into account the staging buffer. This is more in line with how the rest of the Buffer's *Impl functions look and are handled. This also allows some cleanup of overly specialized code. - Coalesces buffer mapping state for clarity. - Updates |completedSerial| in QueueAndSerial to be atomic because spontaneous events may modify and read it concurrently. - Removes device wide lock acquiring when calling GetMappedRange and its variants now that we have an atomic to guarantee some code paths to be valid. This should increase performance on these buffers also. - Refactors Unmap a bit to differentiate internal and external usages. - Manually scope the device lock in Unmap to ensure that the callbacks are triggered in the right places. Bug: 412761228, 418165343, 42241400, 40643114, 417802523 Change-Id: If5ea22f81c6d305d1dee90eb3cf6276061e2f888 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/242715 Reviewed-by: Corentin Wallez <cwallez@chromium.org> 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.