Bug 268425 - [WGSL] override expressions as array lengths do not compile
Summary: [WGSL] override expressions as array lengths do not compile
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tadeu Zagallo
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-01-30 16:39 PST by Mike Wyrzykowski
Modified: 2024-02-08 10:27 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Wyrzykowski 2024-01-30 16:39:22 PST
Running the following CTS test:
  https://gpuweb.github.io/cts/standalone/?q=webgpu:api,validation,compute_pipeline:overrides,workgroup_size,limits,workgroup_storage_size:isAsync=true

We see the error:
  1 error generated while compiling the shader:
  5:45: array count must evaluate to a constant integer expression or override variable

--------------- Shader source ---------------

              override a: u32;
              override b: u32;
              
              var<workgroup> mat4_data: array<mat4x4<f32>, b>;
              @compute @workgroup_size(1) fn main() {
                
                _ = mat4_data[0];
              }
--------------- end shader source ---------------

We can use function constants inside the generated metal shading language array length declaration.
Comment 1 Radar WebKit Bug Importer 2024-01-30 16:39:41 PST
<rdar://problem/121971104>
Comment 2 Tadeu Zagallo 2024-02-06 17:20:07 PST
Pull request: https://github.com/WebKit/WebKit/pull/23972
Comment 3 EWS 2024-02-08 10:27:33 PST
Committed 274296@main (2e6c189562a8): <https://commits.webkit.org/274296@main>

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