NetDEM v1.0
Loading...
Searching...
No Matches
add_block_sums.wgsl.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
6// Define the binding group layout
7@group(1) @binding(1) var<storage, read_write> result_0: array<u32>;
8@group(1) @binding(2) var<storage, read_write> aux_0: array<u32>;
9
10@group(1) @binding(4) var<storage, read_write> result_1: array<u32>;
11@group(1) @binding(5) var<storage, read_write> aux_1: array<u32>;
12
13const WORKGROUP_SIZE : u32 = 256u;
14
15@compute @workgroup_size(WORKGROUP_SIZE)
16fn AddBlockSums(
17 @builtin(global_invocation_id) global_id: vec3<u32>,
18 @builtin(local_invocation_id) local_id: vec3<u32>,
19 @builtin(workgroup_id) group_id: vec3<u32>
20) {
21 let gid = global_id.x;
22 let wid = group_id.x;
23 if gid < arrayLength(&result_0) {
24 result_0[gid] += aux_0[wid];
25 result_1[gid] += aux_1[wid];
26 }
27}
28)";
shader_source
Definition add_block_sums.wgsl.h:5