2021-06-10 18:49:14 +00:00
|
|
|
[[block]] struct Result {
|
|
|
|
values : array<f32>;
|
|
|
|
};
|
|
|
|
|
|
|
|
let width : u32 = 128u;
|
|
|
|
|
|
|
|
[[group(0), binding(0)]] var tex : texture_depth_2d;
|
2021-06-16 09:19:36 +00:00
|
|
|
[[group(0), binding(1)]] var<storage, read_write> result : Result;
|
2021-06-10 18:49:14 +00:00
|
|
|
|
|
|
|
[[stage(compute)]] fn main(
|
|
|
|
[[builtin(global_invocation_id)]] GlobalInvocationId : vec3<u32>
|
|
|
|
) {
|
|
|
|
result.values[GlobalInvocationId.y * width + GlobalInvocationId.x] = textureLoad(
|
|
|
|
tex, vec2<i32>(i32(GlobalInvocationId.x), i32(GlobalInvocationId.y)), 0);
|
|
|
|
}
|