wgpu/naga/tests/in/workgroup-uniform-load.wgsl
2023-10-25 14:25:04 -04:00

13 lines
306 B
WebGPU Shading Language

const SIZE: u32 = 128u;
var<workgroup> arr_i32: array<i32, SIZE>;
@compute @workgroup_size(4)
fn test_workgroupUniformLoad(@builtin(workgroup_id) workgroup_id: vec3<u32>) {
let x = &arr_i32[workgroup_id.x];
let val = workgroupUniformLoad(x);
if val > 10 {
workgroupBarrier();
}
}