commit | 7eca355b81049a6c405e7111ea074b51aadc3b25 | [log] [tgz] |
---|---|---|
author | Corentin Wallez <cwallez@chromium.org> | Thu Aug 21 23:55:49 2025 -0700 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Aug 21 23:55:49 2025 -0700 |
tree | b3f722dcb150acb831433a28125e4b8d7a9a75ed | |
parent | 4e9e28f05f3b2f99bea0f4ded046e0b11d02bc6b [diff] |
[dawn][vk] Implement dynamic array BGLs In Vulkan the equivalent concept to dynamic binding arrays are descriptor arrays with all the VK_KHR_descriptor_indexing flags enabled. The allocation strategy for the VkDescriptorSet needs to change as the sets may have varying size even if used on the same layout. This in turns requires a different, simpler version of the DescriptorSetAllocator to be used. In order to minimize the amount of additional branching that happens because of the bindless path (which is cold, but static-only bindgroups are perf critical), BindGroupLayoutVk is split into two subclasses that dispatch to the regular DescriptorSetAllocator or a new DescriptorSetAllocatorDynamicArray. (I tried 4 different approaches and the current one seems to be the less disgusting one) Changes in this CL are: - Remove logic in DescriptorSetAllocator to handle pool sizes of 0 as this is no longer a Vulkan error to do, and VVLs don't complain anymore. - Add DescriptorSetAllocatorDynamicArray that creates descriptor sets with variable counts and doesn't do any recycling or suballocation of the underlying VkDescriptorPool (apps should create few dynamic array bindgroups). - Split vulkan::BindGroupLayout into a base class and a child class for StaticBindingOnly. - Factor out the code that computes information related to static bindings into its own function. - Add a BindGroupLayoutDynamicArray that creates a VkDescriptorSetLayout with a variable count and uses DescriptorSetAllocatorDynamicArray. - In BindGroupLayoutInternalBase, decide that the dynamic array will directly follow the static bindings, and have separate getters that return either a BindingNumber or a BindingIndex. This change can barely be tested on its own, but end2end tests with BindGroup dynamic array creation in follow up CLs found a bunch of bugs and will provide coverage. Bug: 439522242 Change-Id: Ia24227aed66831caa4cb8d3bfe1407ed420fdca2 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/257774 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org> Commit-Queue: 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.