Bug 266638

Summary: [WGSL] https://compute.toys/view/734 fails to compile
Product: WebKit Reporter: Mike Wyrzykowski <mwyrzykowski>
Component: WebGPUAssignee: Tadeu Zagallo <tzagallo>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
shader source none

Description Mike Wyrzykowski 2023-12-19 09:00:12 PST
[WGSL] https://compute.toys/view/734 fails to compile
Comment 1 Mike Wyrzykowski 2023-12-19 09:00:26 PST
9 errors generated while compiling the shader:
131:25: cannot call value of type 'f32'
300:47: cannot call value of type 'f32'
312:15: cannot call value of type 'i32'
326:36: cannot call value of type 'u32'
328:28: cannot call value of type 'i32'
341:12: cannot call value of type 'f32'
342:12: cannot call value of type 'f32'
343:12: cannot call value of type 'f32'
359:27: cannot call value of type 'f32'
Comment 2 Radar WebKit Bug Importer 2023-12-19 09:01:22 PST
<rdar://problem/119870669>
Comment 3 Mike Wyrzykowski 2023-12-19 10:00:18 PST
Created attachment 469130 [details]
shader source
Comment 4 Mike Wyrzykowski 2023-12-19 10:00:54 PST
Failing lines are:

131:    return float4(state)/float(0xffffffffu);
300:            var color = spectral_zucconi(400 + 0.2*float(i-512));
312:     let idx0 = int(id.x) + int(screen_size.x * int(id.y));
326:     state = uint4(id.x, id.y, id.z, uint(custom.NoiseAnimation)*time.frame);
328:     for(var i: i32 = 0; i < int(custom.Samples*MaxSamples + 1.0); i++)
341:      let x = float(atomicLoad(&atomic_storage[idx*4+0]));
342:      let y = float(atomicLoad(&atomic_storage[idx*4+1]));
343:      let z = float(atomicLoad(&atomic_storage[idx*4+2]));    
359:      let fragCoord = float2(float(id.x) + .5, float(id.y) + .5);

Its possible some of these are due to Tint being out of compliance with the current WGSL specification, see https://github.com/gpuweb/gpuweb/issues/4415#issuecomment-1850152484
Comment 5 Tadeu Zagallo 2023-12-27 07:47:52 PST
Pull request: https://github.com/WebKit/WebKit/pull/22251
Comment 6 EWS 2023-12-28 05:02:51 PST
Committed 272519@main (4375e00da390): <https://commits.webkit.org/272519@main>

Reviewed commits have been landed. Closing PR #22251 and removing active labels.