Bug 261901 - [WGSL] Support Synchronization Built-in Functions
Summary: [WGSL] Support Synchronization Built-in Functions
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-21 12:36 PDT by Mike Wyrzykowski
Modified: 2023-09-21 12:37 PDT (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 2023-09-21 12:36:51 PDT
[WGSL] Support Synchronization Built-in Functions - https://www.w3.org/TR/WGSL/#sync-builtin-functions

First two are easy: [WGSL] => [MSL] mapping
* storageBarrier => threadgroup_barrier(mem_flags::mem_device)
* workgroupBarrier => threadgroup_barrier(mem_flags::mem_threadgroup)

Last one expands to this I think
* workgroupUniformLoad => 
uint metalWorkgroupUniformLoad(threadgroup T* const p) 
{
  threadgroup_barrier(mem_flags::mem_threadgroup);
  const T result = *p;
  threadgroup_barrier(mem_flags::mem_threadgroup);
  return result;
}
Comment 1 Radar WebKit Bug Importer 2023-09-21 12:37:10 PDT
<rdar://problem/115855666>