Fix Oversized D3D11 Immediate Uniform Buffer kMaxImmediateSizeD3D11 was defined as sizeof(RenderImmediates / ComputeImmediates), i.e. a byte count, but every use treats it as a number of uint32_t elements: it sizes std::array<uint32_t, N>, bounds the element offset, and multiplies by sizeof(uint32_t) for the GPU buffer byte size. As a result the CPU array and the GPU uniform buffer were 4x larger than needed. Rename the constant to kMaxImmediateSlotsD3D11 and convert the maximum immediate struct byte size to uint32_t slots with Align, so the buffer stays correctly sized even if a struct size is not a multiple of four. Make IsPowerOfTwo constexpr so Align can be used in constant expressions, and add compile-time coverage for both helpers. Bug: 366291600 Change-Id: I7375650f0de766b154f72e8ef4f70ba266d5248a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/329755 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Quyen Le <lehoangquyen@google.com>
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.