#[compute]
#version 450

layout( local_size_x = 8, local_size_y = 8, local_size_z = 1 ) in;

layout( set = 0, binding = 0 ) 
uniform sampler2D inputImage;

layout( rgba16, set = 1, binding = 0 ) 
uniform restrict writeonly image2D outputImage;

void main() 
{
  ivec2 size = imageSize( outputImage );
	ivec2 xy = ivec2( gl_GlobalInvocationID.xy );

  if ( any( greaterThanEqual( xy, size ) )  ) 
  {
    return;
  }

  vec2 uv = ( vec2( xy ) + vec2( 0.5 ) ) / vec2( size ); 

	vec4 color = texture( inputImage, uv ); 

	imageStore( outputImage, xy, color );
}
