Bug 302750
| Summary: | WGSL compilation: cannot use override value in constant expression | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | georgsh-yateam |
| Component: | WebGPU | Assignee: | Tadeu Zagallo <tzagallo> |
| Status: | RESOLVED FIXED | ||
| Severity: | Major | CC: | mwyrzykowski, tzagallo, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 26 | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 26 | ||
georgsh-yateam
WGSL shader don't compiles on macos/safari when declared 2 same arrays.
But it compiles on linux/chrome, android/chrome.
Error message also strange, override keyword not present in wgsl source:
=====
const PTK_HASHDATA = array<array<u32, 16>, 1>(array<u32, 16>(0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0));
const EAPOL_HASHDATA = array<array<u32, 16>, 1>(array<u32, 16>(0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0));
@group(0) @binding(0) var<storage, read> input: array<u32>;
@group(0) @binding(1) var<storage, read_write> output: array<u32>;
@compute @workgroup_size(64)
fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
output[gid.x] = gid.x;
}
=====
Quick check:
https://georg95.github.io/wgsl-safari-bug.html
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
georgsh-yateam
So, actually issue is you can't declare 2-d const arrays.
Can change to const to var<private>, but probably with performance penalty
Radar WebKit Bug Importer
<rdar://problem/165093959>
Tadeu Zagallo
Pull request: https://github.com/WebKit/WebKit/pull/56885
EWS
Committed 306020@main (4f07563c85a8): <https://commits.webkit.org/306020@main>
Reviewed commits have been landed. Closing PR #56885 and removing active labels.