[dawn][native] Cleanup BGL creation to better support arraySize Support for arraySize needs to update ExtractAndExpandBglEntries in awkward ways because that method and other related code had accumulated debt. Refactor it a bit in preparation for arraySize. - Separate the binding counts used to iterate the BGL from the ones used for the validation of total binding counts in the pipeline layouts. Extra bindings are accounted for in BindingCounts for currently unused ExternalTexture reserved resources (one sampler and two sampled textures) and the confusion could cause subtle bugs in the future. - Change ExtractAndExpandBglEntries to do the conversion to BindingInfo internally, which avoids the need to store a linked list of BindGroupLayoutEntry on the side. Rename it to ConvertAndExpandBGLEntries. - Make it return all of its results by value instead of a mix with pointers (also go down from 6 things returned to only 2). - Update SortBindingsCompare to work with BindingInfo and simplify the logic to only what is needed to get the invariants that BGL requires. - Make the various *BindingLayout aggregate types by removing their constructors and using a static ::From member function instead. - Move operator == and != to BindingInfo instead of having it defined in BindGroupLayoutInternal.h - Remove / inline a couple unused BindGroupLayoutInternal member functions. Bug: 393558555 Change-Id: Idc5365b61460a51ed30d6e829b37dcb05ebd76e5 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/236415 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Brandon Jones <bajones@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.