title: GLSL imageStore slower on uimageBuffer than on uimage2D?
body: <p>I have a #version 420 GLSL vertex shader that writes to a texel (always the same one) of an uimage using the imageStore function. (In the actual release version, I use more than one texel, so this setup is just an extreme test case for performance measuring.)</p>
  
  <p>I tried two different ways: </p>
  
  <ul>
  <li><p>writing to an 'layout(r32ui) coherent uniform uimage2D',
  i.e., I bound a GL_TEXTURE_2D to the image unit</p></li>
  <li><p>writing to an 'layout(r32ui) coherent uniform uimageBuffer',
  i.e, I bound a GL_TEXTURE_BUFFER to the image unit, which itself has a VBO with GL_STATIC_DRAW bound)</p></li>
  </ul>
  
  <p>In a test scene with 360K vertices, for both alternatives I measure different performances (The vertices are simply rasterized as GL_POINTS, so the fragment shader effort is neglectible):</p>
  
  <ul>
  <li>shader without imageStore: 2.1 ms</li>
  <li>const-coord imageStore to uimage2D: 2.1 ms</li>
  <li>const-coord imageStore to uimageBuffer: 3.2 ms</li>
  </ul>
  
  <p>So, it seems that imageStore to an imageBuffer is somehow slower than to an image2D. But it gets worse. If I don't imageStore to a fixed texel with constant coordinate as above, but use a dynamically determined offset, the I get these performances:</p>
  
  <ul>
  <li>dynamic-coord imageStore to uimage2D: 2.1 ms</li>
  <li>dynamic-coord imageStore to uimageBuffer: 7.2 ms</li>
  </ul>
  
  <p>Can anyone confirm this performance difference, or explain why writing to a uimageBuffer is so much slower than writing to a uimage2D? Is it because of the VBO bound to the Buffer-Texture? Or do I seem to have done something wrong?</p>
  
  <p>I also should mention that the vertex shader also uses a second uimage2D for some atomic counting stuff, but that is the same for each case and should have nothing to do with the imageStore.</p>