[vulkan] Report a maxBufferSize that is a multiple of 4 On Vulkan, Dawn rounds non-host-mapped buffer allocation sizes up to a multiple of 4 bytes. When VK_KHR_maintenance4 is supported, maxBufferSize is taken directly from the driver, which on Mesa lavapipe is 0xffffffff (4 GiB - 1). Creating a buffer at that limit rounds the Vulkan size up to 0x100000000 and fails vkCreateBuffer with OOM (hit by webgpu:api,validation,buffer,create:limit with untiered limits). Align Vulkan's reported maxBufferSize down to a multiple of 4 (0xfffffffc on lavapipe) and assert this in MaxLimitTests.MaxBufferSizes. This does not cover the extra padding added for vertex, index, or uniform buffers. Bug: None This is an imported pull request from https://github.com/google/dawn/pull/97 GITHUB_PR_HEAD_SHA=0ba9b5727d8c53d85e79723281f8129ca968a32a ORIGINAL_AUTHOR=Alex Soliman <alexander.soliman@gmail.com> GitOrigin-RevId: ecb5b48c05825978d38a4474ccb128069d27afb8 Change-Id: I79d9efced95199ef4489aaef45496c359b498a08 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/361637 Reviewed-by: dan sinclair <dsinclair@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> 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.