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, ${IMAGE_FORMAT[DTYPE]}) uniform PRECISION restrict writeonly ${IMAGE_T[NDIM][DTYPE]} image_out; 16layout(set = 0, binding = 1) uniform PRECISION sampler3D image_in; 17 18layout(set = 0, binding = 2) uniform PRECISION restrict OutLimits { 19 ivec3 out_limits; 20}; 21 22layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; 23 24void main() { 25 ivec3 pos = ivec3(gl_GlobalInvocationID); 26 if (any(greaterThanEqual(pos, out_limits))) { 27 return; 28 } 29 imageStore(image_out, pos, texelFetch(image_in, pos, 0)); 30} 31