• 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 writeonly image3D   uOutput;
10layout(set = 0, binding = 1)         uniform PRECISION                    isampler3D uInput; //quantized input
11layout(set = 0, binding = 2)         uniform PRECISION restrict           Block {
12  ivec4 size;
13  vec2 scale;
14  ivec2 zero_point;
15} uBlock;
16
17layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
18
19void main() {
20  const ivec3 pos = ivec3(gl_GlobalInvocationID);
21  if (all(lessThan(pos, uBlock.size.xyz))) {
22    vec4 texel = texelFetch(uInput, pos, 0);
23    imageStore(
24        uOutput,
25        pos,
26        (uBlock.scale.x * (texel - uBlock.zero_point.x)));
27  }
28}
29