xref: /aosp_15_r20/external/executorch/backends/vulkan/test/glsl/test_shader.glsl (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree.
7 */
8
9#version 450 core
10
11#define PRECISION ${PRECISION}
12
13layout(std430) buffer;
14
15layout(set = 0, binding = 0, rgba32f) uniform PRECISION restrict writeonly image3D   uOutput;
16layout(set = 0, binding = 1) uniform PRECISION sampler3D uInput;
17layout(set = 0, binding = 2) uniform PRECISION restrict Block {
18  ivec4 size;
19} uBlock;
20
21layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
22
23void main() {
24  const ivec3 pos = ivec3(gl_GlobalInvocationID);
25
26  if (all(lessThan(pos, uBlock.size.xyz))) {
27    const vec4 intex = texelFetch(uInput, pos, 0);
28    imageStore(
29        uOutput,
30        pos,
31        intex + 5);
32  }
33}
34