[M148][native][d3d12] Fix and rework ShaderVisibleDescriptorAllocator With https://g-issues.chromium.org/issues/496379067, a bug was introduced where the first time we pooled a heap, it would pool a non-max sized one. Also, this CL introduced a performance regression: because we no longer doubled the heap size when calling AllocateAndSwitchShaderVisibleHeap, unless we explicitly requested to allocate a max size heap, most calls would result in allocating a new heap, and never recycling from a pool. This CL reworks ShaderVisibleDescriptorAllocator so that we once again double the heap size when AllocateAndSwitchShaderVisibleHeap is called, making sure it's large enough to fit the request size. - Refactored the function to split adding heaps to the pool vs retrieving them. - Added assertions to make sure the heap sizes are what we expect. - Fixed D3D12DescriptorHeapTests. Bug: 496379067 Change-Id: I01d5dfb8148d5ed0621901355f2da034f6174fe8 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/303915 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com> (cherry picked from commit 419c7b7c91a11a1e20196543549bfc8a03dd98ed) Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/305336
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.