#version 120 
#extension GL_EXT_gpu_shader4 : require

uniform vec2 clipInfo;
uniform sampler2D myDepth;

#if __VERSION__ == 120
//  Compatibility with older versions of GLSL
#   define texelFetch texelFetch2D
#   define result gl_FragColor.r
#else
    out float     result;
#endif

float reconstructCSZ(float d) 
{
//uniform vec2 cNearFarAB;
  return clipInfo.y / (d - clipInfo.x);
}

void main(void)
{
  result = reconstructCSZ(texelFetch(myDepth, ivec2(gl_FragCoord.xy), 0).r); 
}                                                  
