Bug 262135

Summary: [WGSL] Buffer dynamic offsets are not implemented
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-09-26 13:04:43 PDT
[WGSL] Buffer dynamic offsets are not implemented

This offset would probably be in its own buffer because the pipeline doesn't know the value until right before draw time. 

So:
[[vertex]] type2 function0(type3 parameter0 [[stage_in]], constant type5& parameter1 [[buffer(22)]])
{
    const constant type4& local0 = parameter1.uniforms;

would become something like:

[[vertex]] type2 function0(type3 parameter0 [[stage_in]], constant type5& parameter1 [[buffer(22)]], constant uint32_t* offsets [[buffer(23)]])
{
    const constant type4& local0 = *(const constant type4*)((constant char*)&parameter1.uniforms + offsets[INDEX]));

where INDEX is 0,1,2... corresponding to the nth buffer in the bind group
Comment 1 Radar WebKit Bug Importer 2023-09-26 13:05:02 PDT
<rdar://problem/116073820>
Comment 2 Tadeu Zagallo 2023-10-12 04:53:01 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18992
Comment 3 EWS 2023-10-17 11:30:21 PDT
Committed 269418@main (7990584a04b5): <https://commits.webkit.org/269418@main>

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