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]} uOutput; 16layout(set = 0, binding = 1) uniform PRECISION restrict Block { 17 ivec3 size; 18 int fill; 19 vec4 vals; 20} params; 21 22layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; 23 24void main() { 25 const ivec3 pos = ivec3(gl_GlobalInvocationID); 26 27 if (any(greaterThanEqual(pos, params.size))) { 28 return; 29 } 30 31 imageStore(uOutput, pos, params.vals); 32} 33