Fix use-after-free for empty buffer/texture copy workarounds Empty buffer-texture copies (zero-sized copy extents) skipped command recording within certain workaround paths (e.g., blit-to-depth/stencil, oversized-row split). Because mTopLevelBuffers and mTopLevelTextures held raw pointers, and the only Ref keeping them alive was the recorded command, skipping recording left these pointers dangling, causing a UAF in QueueBase::ValidateSubmit. Add an early-out for empty copies in APICopyBufferToTexture, APICopyTextureToBuffer, and APICopyTextureToTexture. They now record the plain copy command and return before any workaround runs. - Add DAWN_CHECK(!copyExtent.IsEmpty()) to workarounds as a release-mode backstop. - Add regression tests for empty B2T and T2B copies. Bug: 571648522 Change-Id: I88bd7f82df6a27a39c65747eb49a768e4f00f13f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/350415 Commit-Queue: Li, Hao X <hao.x.li@intel.com> Reviewed-by: Corentin Wallez <cwallez@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.