1layout(std430) buffer; 2layout(FORMAT, binding=0) writeonly uniform PRECISION image3D uOutput; 3layout(location=1) uniform mediump sampler3D uInput; 4layout(location = 2) uniform int width; 5layout(location = 3) uniform int height; 6layout(location = 4) uniform int channel; 7 8layout (local_size_x = XLOCAL, local_size_y = YLOCAL, local_size_z = ZLOCAL) in; 9 10void main() 11{ 12 ivec3 pos = ivec3(gl_GlobalInvocationID); 13 if (pos.x < width && pos.y < height && pos.z < channel) 14 { 15 vec4 result = texelFetch(uInput, pos, 0); 16 imageStore(uOutput, pos, result); 17 } 18} 19