Spaces:
Running

File size: 413 Bytes
1d919a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// A refused write leaves no current on its edges. flag[0] is 1 when the wedge kept the write.
// No paper equation.

override N: u32;

@group(0) @binding(0) var<storage, read> flag: array<u32>;
@group(0) @binding(1) var<storage, read_write> e: array<f32>;

@compute @workgroup_size(64)
fn main(@builtin(global_invocation_id) gid: vec3u) {
  if (flag[0] != 0u || gid.x >= N) {
    return;
  }
  e[gid.x] = 0.0;
}