Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1// Consolidates the alternating ShapeCombine outputs into AnimWaves.
3const LOD_COUNT: u32 = 5u;
5@group(0) @binding(0) var scratch_a: texture_2d_array<f32>;
6@group(0) @binding(1) var scratch_b: texture_2d_array<f32>;
7@group(0) @binding(2) var output: texture_storage_2d_array<rgba16float, write>;
9@compute @workgroup_size(8, 8, 1)
10fn gather(@builtin(global_invocation_id) id: vec3<u32>) {
11 if any(id.xy >= vec2<u32>(256u)) || id.z >= LOD_COUNT {
12 return;
13 }
14 let value = select(
15 textureLoad(scratch_a, vec2<i32>(id.xy), i32(id.z), 0),
16 textureLoad(scratch_b, vec2<i32>(id.xy), i32(id.z), 0),
17 id.z % 2u == 0u,
18 );
19 textureStore(output, vec2<i32>(id.xy), i32(id.z), value);
Contents