• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 450 core
2#define PRECISION ${PRECISION}
3#define FORMAT ${FORMAT}
4
5layout(std430) buffer;
6
7/* Qualifiers: layout - storage - precision - memory */
8
9layout(set = 0, binding = 0, FORMAT) uniform PRECISION restrict image3D   uOutput;
10layout(set = 0, binding = 1)         uniform PRECISION          sampler3D uInput0;
11layout(set = 0, binding = 2)         uniform PRECISION          sampler3D uInput1;
12layout(set = 0, binding = 3)         uniform PRECISION restrict Block {
13  ivec4 size;
14  ivec4 isize0;
15  ivec4 isize1;
16} uBlock;
17
18layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
19
20void main() {
21  const ivec3 pos = ivec3(gl_GlobalInvocationID);
22
23  if (all(lessThan(pos, uBlock.size.xyz))) {
24    const ivec3 input0_pos = pos % uBlock.isize0.xyz;
25    const ivec3 input1_pos = pos % uBlock.isize1.xyz;
26    imageStore(
27        uOutput,
28        pos,
29        imageLoad(uOutput, pos)
30          + texelFetch(uInput1, input1_pos, 0)
31          * (texelFetch(uInput0, input0_pos, 0) - imageLoad(uOutput, pos)));
32  }
33}
34