2021-12-09 15:45:03 +00:00
|
|
|
struct Result {
|
2022-03-28 14:31:22 +00:00
|
|
|
values : array<f32>,
|
2021-06-10 18:49:14 +00:00
|
|
|
};
|
|
|
|
|
2022-06-29 00:55:36 +00:00
|
|
|
const width : u32 = 128u;
|
2021-06-10 18:49:14 +00:00
|
|
|
|
2022-01-19 22:46:57 +00:00
|
|
|
@group(0) @binding(0) var tex : texture_depth_2d;
|
|
|
|
@group(0) @binding(1) var<storage, read_write> result : Result;
|
2021-06-10 18:49:14 +00:00
|
|
|
|
2022-06-07 13:55:34 +00:00
|
|
|
@compute @workgroup_size(1) fn main(
|
2022-01-19 22:46:57 +00:00
|
|
|
@builtin(global_invocation_id) GlobalInvocationId : vec3<u32>
|
2021-06-10 18:49:14 +00:00
|
|
|
) {
|
|
|
|
result.values[GlobalInvocationId.y * width + GlobalInvocationId.x] = textureLoad(
|
|
|
|
tex, vec2<i32>(i32(GlobalInvocationId.x), i32(GlobalInvocationId.y)), 0);
|
|
|
|
}
|