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(0) @binding(1) var<storage, read_write> result: array<u32>;
8@group(0) @binding(2) var<storage, read_write> aux: array<u32>;
9
10const WORKGROUP_SIZE : u32 = 256u;
11
12@compute @workgroup_size(WORKGROUP_SIZE)
13fn AddBlockSums(
14 @builtin(global_invocation_id) global_id: vec3<u32>,
15 @builtin(local_invocation_id) local_id: vec3<u32>,
16 @builtin(workgroup_id) group_id: vec3<u32>
17) {
18 let gid = global_id.x;
19 let wid = group_id.x;
20 if gid < arrayLength(&result) {
21 result[gid] = result[gid] + aux[wid];
22 }
23}
24)";
shader_source
Definition add_block_sums.wgsl.h:5