/ proof-of-concept / steelsim31
Sign in
proof-of-concept / steelsim31
steelsim31 / src / sim / shaders / extract.wgsl
12 lines · 416 BCodeBlameHistory
d8f9e54Clean rebuild of the steel sheet simulatorJeremy Magland 1// Copies the transverse displacement into a plain f32 array (display / movie frame).
3@group(0) @binding(0) var<uniform> P: Params;
4@group(0) @binding(1) var<storage, read> pos: array<f32>;
5@group(0) @binding(2) var<storage, read_write> out: array<f32>;
7@compute @workgroup_size(256)
8fn main(@builtin(global_invocation_id) gid: vec3u) {
9 let k = gid.x;
10 if (k >= P.n) { return; }
11 out[k] = pos[2u * P.n + k];
↑↓ move↵openescclose