Bug 263564

Summary: [WGSL] texture_external as a global generates incorrect indices
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   

Description Mike Wyrzykowski 2023-10-23 16:09:14 PDT
Given the following WGSL globals:

@group(0) @binding(0) var inputTexture0: texture_external;
@group(0) @binding(1) var <uniform> kernel_offsets: array<vec4f, 9>;
@group(0) @binding(2) var <uniform> kernels: array<mat4x4f, 9>;
@group(0) @binding(3) var <uniform> bias: vec4f;


They appear to generate this AB:

struct __ArgumentBufferT_0 {
    texture2d<float> __global0_FirstPlane;
    texture2d<float> __global0_SecondPlane;
    float3x2 __global0_UVRemapMatrix;
    float4x3 __global0_ColorSpaceConversionMatrix;
    const constant array<vec<float, 4>, 9>& global1 [[id(1)]];
    const constant array<matrix<float, 4, 4>, 9>& global2 [[id(2)]];
    const constant vec<float, 4>& global3 [[id(3)]];
};

but [[id(1)]] should be [[id(4)]]
Comment 1 Radar WebKit Bug Importer 2023-10-23 16:09:32 PDT
<rdar://problem/117379167>
Comment 2 Tadeu Zagallo 2023-10-27 08:09:07 PDT
Pull request: https://github.com/WebKit/WebKit/pull/19641
Comment 3 EWS 2023-10-30 22:38:07 PDT
Committed 269996@main (e1551b11d288): <https://commits.webkit.org/269996@main>

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