Support mappedAtCreation for SharedBufferMemory buffers SharedBufferMemory::CreateBuffer did not call MapAtCreation() when the descriptor had mappedAtCreation=true, causing GetMappedRange() to return nullptr after BeginAccess. Fix by: - Calling MapAtCreation() in SharedBufferMemoryBase::CreateBuffer when mappedAtCreation is set. - Adding mIsMappedAtCreation to BufferBase, set in MapAtCreationInternal() and cleared in Unmap(), so that OnBeginAccess() restores MappedAtCreation state (instead of always Unmapped) when BeginAccess is called on a still-mapped buffer. - Making BufferBase::GetState() public so BeginAccess can detect the MappedAtCreation state and skip SetInitialized(descriptor->initialized), preserving the initialized=true already set by MapAtCreation() and preventing lazy-clear from zeroing user-written data on the first GPU read. Bug: 386255678 Change-Id: Ic719265f6e291d95297d498690eacf4c0c6192ca Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/320815 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Shao, Jiawei <jiawei.shao@intel.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.