Add DAWN_MULTILINE for minifying WGSL strings And use it instead of raw strings in most places. While doing that, also fixed the indentation of a bunch of strings (and tried to make them look nice in the surrounding context) and removed a bit of manually-added whitespace from generated strings, since generated shaders are no longer nicely formatted at all. Both clang-format and cpplint have minor issues with this approach because they can't tell that the string is not C++ code. - clang-format's WhitespaceSensitiveMacros option is buggy, so we need to pepper blank comments in a few places to prevent it from reformatting things it's not supposed to touch. - cpplint has no option to disable for multiple lines, so one rule that triggers often on WGSL is easiest to just disable. Maybe this will not matter in the future, if we fully replace cpplint with clang-tidy. In a local Skia build (with clang 17.0.0 from the system Xcode because Skia isn't using a hermetic build on my Mac), this saves 22.3k: -159255840 out/DawnVulkan/libdawn_combined.a +159233520 out/DawnVulkan/libdawn_combined.a Fixed: 475274568 Change-Id: Ibd70eefc7e314f8689bf06803e681a1ec10302d0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/284555 Auto-Submit: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kaylee Lubick <kjlubick@google.com> 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.