Add a trace option to the Metal Backend This works by setting DAWN_TRACE_FILE_BASE=foo which results in a trace foo-yyyy-mm-dd-hh-mm-ss-count.gputrace being written. You can also set DAWN_TRACE_DEVICE_FILTER to have traces only written when the device's label contains the filter string. The trace runs from device creation until device destroy so no extra API needed. Ultimately it would be nice to make this work on all backends with the same environment variables but this was easy to put in and is useful for devs on Metal, especially in dawn.node with compute only captures. To use you need somethnng like ``` METAL_CAPTURE_ENABLE=1 DAWN_TRACE_FILE_BASE=foo prog-that-uses-dawn-metal ``` Which will write out something like `foo-2025-02-12T12-05-07-c000.gputrace` Bug: 396072565 Change-Id: I67271f3fff8ac18f56e48a4960f9ef493f77bfcf Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/226174 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Gregg Tavares <gman@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.