Remove usages of assert(), add PRESUBMIT checks assert() is controlled by NDEBUG, but that's confusing because we actually control asserts via DAWN_ENABLE_ASSERTS. Make all asserts consistently use DAWN_ASSERT and DAWN_ENABLE_ASSERTS. DAWN_ASSERT is also better because it avoids unused variable warnings. (The genesis of this change was discovering one [[maybe_unused]] that was only necessary because of an assert().) Adds both PRESUBMIT and Clang-Tidy rules to try to enforce this. Unfortunately the NDEBUG check won't be totally warning-clean because sometimes we actually want that and not DAWN_ENABLE_ASSERTS. In fact I didn't find any place we used it wrong - there's only one place NDEBUG is used; the other one that was incorrect was already fixed: https://dawn.googlesource.com/dawn/+/098fd8d2225013faec7bfaa3bccd2022a19cb19f Note there are some places where assert() is implicitly in scope for some reason, but we didn't explicitly include <cassert>. These are detected best-effort (if they're single-line) by PRESUBMIT. assert() is a macro, not a function, so we can't detect these with bugprone-unsafe-functions.CustomFunctions. Bug: 501491694 Change-Id: I583edcedddc09c8f11d1315c6de76957e6f5d498 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/345796 Reviewed-by: dan sinclair <dsinclair@chromium.org> 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.