#version 310 es
precision mediump float;

layout(rgba16i) uniform highp writeonly iimage3D arg_0_1;
void textureDimensions_1b71f0() {
  ivec3 res = imageSize(arg_0_1);
}

vec4 vertex_main() {
  textureDimensions_1b71f0();
  return vec4(0.0f, 0.0f, 0.0f, 0.0f);
}

void main() {
  vec4 inner_result = vertex_main();
  gl_Position = inner_result;
  gl_Position.y = -(gl_Position.y);
  gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
  return;
}
#version 310 es
precision mediump float;

layout(rgba16i) uniform highp writeonly iimage3D arg_0_1;
void textureDimensions_1b71f0() {
  ivec3 res = imageSize(arg_0_1);
}

void fragment_main() {
  textureDimensions_1b71f0();
}

void main() {
  fragment_main();
  return;
}
#version 310 es
precision mediump float;

layout(rgba16i) uniform highp writeonly iimage3D arg_0_1;
void textureDimensions_1b71f0() {
  ivec3 res = imageSize(arg_0_1);
}

void compute_main() {
  textureDimensions_1b71f0();
}

layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
  compute_main();
  return;
}
