Add validations on `clip_distances` and maximum inter-stage location This patch adds the validation on the use of `clip_distances` and the maximum location of the inter-stage shader variables according to the latest WebGPU SPEC. `clip_distances` will not only consume inter-stage shader variable slots, but also consume the maximum location of inter-stage shader variables, which is required by Vulkan. According to the Vulkan validation layer, the total number of inter-stage shader components is computed by the maximum location of all the inter-stage shader variables, so we should reserve the locations for `clip_distances`. For example, suppose the maximum location of the vertex outputs is 30, and there is builtin position (4) and clip_distances with size 1, so the Vulkan validation layer thinks the total vertex shader output components is 129 (31 * 4 + 4 + 1) which is over the maximum number of the total vertex shader output components on Intel GPUs. Bug: 358408571 Test: dawn_unittests, dawn_end2end_tests Change-Id: If89cb10b63011dd34df71389411072b4a5cc5d18 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/206354 Reviewed-by: Corentin Wallez <cwallez@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.