title: imageLoad and imageStore Seemingly not Defined
body: <p>I'm working on implementing a single pass depth-peeling algorithm by using atomic textures in OpenGL 4.2.  I wrote the following fragment program:</p>
  
  <pre><code>#version 420 core
  layout(r32i) coherent uniform iimage2D img2D_0;
  uniform iimage2D img2D_1;
  in vec3 pos;
  vec4 insert(vec4 data, float new_data) {
      if      (new_data&lt;data.x) return vec4(      new_data,data.xyz);
      else if (new_data&lt;data.y) return vec4(data.x,new_data,data.yz);
      else if (new_data&lt;data.z) return vec4(data.xy,new_data,data.z);
      else if (new_data&lt;data.w) return vec4(data.xyz,new_data      );
      else                      return data;
  }
  void main() {
      ivec2 coord = ivec2(gl_FragCoord.xy);
      while (imageAtomicCompSwap(img2D_0,coord,0,1)==1);
      vec4 depths = imageLoad(img2D_1,coord);
      depths = insert(depths,gl_FragCoord.z);
      imageStore(img2D_1,coord,depths);
      memoryBarrier();
      imageAtomicExchange(img2D_0,coord,0);
  }
  </code></pre>
  
  <p>However, I get the following errors:</p>
  
  <pre><code>Fragment info
  -------------
  0(15) : error C1115: unable to find compatible overloaded function "imageLoad(struct iimage2D, ivec2)"
  0(17) : error C1115: unable to find compatible overloaded function "imageStore(struct iimage2D, ivec2, vec4)
  </code></pre>
  
  <p>I note that I am using #version 420 in the shader, and I checked the functions' declarations in the documentation (<a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imageLoad.xml" rel="nofollow">imageLoad</a>, <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imageStore.xml" rel="nofollow">imageStore</a>) and they seem to match.  Curiously, imageAtomicCompSwap, memoryBarrier, and imageAtomicExchange seem to be defined.  Why could these errors occur?</p>