| commit | 75f554d9739cb62a3fcdd0e8cafb9115cd853787 | [log] [tgz] |
|---|---|---|
| author | Corentin Wallez <cwallez@chromium.org> | Thu Jun 17 16:04:29 2021 +0000 |
| committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jun 17 16:04:29 2021 +0000 |
| tree | 6fc2bc476822d660e0e56b1863b93520b677aed9 | |
| parent | 36edf8d8503cfac4c7f75c8db8231096b3c73b9e [diff] |
WireCmd: disallow optional members with length="otherMember"
This didn't make sense since these members can be specified to have no
data by setting the length to 0.
- Prevent uses of this patten by adding an assert in WireCmd.cpp's
generator.
- Fix SetBindGroup dynamicOffset to not be optional but default to
nullptr instead.
This issues would cause a read of uninitialized pointers becaus the
generator code looked like this:
SetBindGroupCmd cmd;
cmd.dynamicOffsetCount = record.dynamicOffsetCount; // 1
bool has_dynamicOffset = record.has_dynamicOffsetl // false
if (has_dynamicOffset) {
cmd.dynamicOffsets = ...;
}
// Oh no! dynamicOffsets contains garbage even if dynamicOffsetCount
// is set to 1. dawn_native will happily read it.
Bug: chromium:1220036
Change-Id: I5c468b639f671cef3be2fa64667a0bf114fc902b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54643
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Dawn is an open-source and cross-platform implementation of the work-in-progress 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)
(TODO)
Apache 2.0 Public License, please see LICENSE.
This is not an officially supported Google product.