[webkit-changes] [WebKit/WebKit] f08d48: [WebGPU] Auto-generated layouts may result in buff...
mwyrzykowski
noreply at github.com
Wed Dec 4 10:30:10 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f08d48cf50be950f02c2c5994da80de9d1d78375
https://github.com/WebKit/WebKit/commit/f08d48cf50be950f02c2c5994da80de9d1d78375
Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
Date: 2024-12-04 (Wed, 04 Dec 2024)
Changed paths:
A LayoutTests/fast/webgpu/nocrash/fuzz-283989-expected.txt
A LayoutTests/fast/webgpu/nocrash/fuzz-283989.html
M Source/WebGPU/WGSL/GlobalVariableRewriter.cpp
M Source/WebGPU/WebGPU/BindGroupLayout.mm
Log Message:
-----------
[WebGPU] Auto-generated layouts may result in buffer and its size being placed at the same index
https://bugs.webkit.org/show_bug.cgi?id=283989
rdar://140803218
Reviewed by Tadeu Zagallo and Dan Glastonbury.
There were two bugs, first was we were generating ABs in some cases like:
struct __ArgumentBufferT_2 {
unsigned __ArgumentBufferPlaceholder_1 [[id(1)]];
device void* __ArgumentBufferPlaceholder_73 [[id(0)]];
};
but this is not supported by Metal. Indices must be in increasing order.
The next issue was in the bind group layout creation, the last element was
not necessarily the one at the maximum index since the sorting did not
occur until later. But we can simply track the max index per stage and use
that instead.
* LayoutTests/fast/webgpu/nocrash/fuzz-283989-expected.txt: Added.
* LayoutTests/fast/webgpu/nocrash/fuzz-283989.html: Added.
* Source/WebGPU/WGSL/GlobalVariableRewriter.cpp:
(WGSL::RewriteGlobalVariables::insertStructs):
Ensure bindings are sorted by AB index.
* Source/WebGPU/WebGPU/BindGroupLayout.mm:
(WebGPU::Device::createBindGroupLayout):
Ensure the max index per stage is actually the maximum.
Canonical link: https://commits.webkit.org/287351@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list