title: Semantics of barrier() in opengl compute shader
body: <p>Let's say I have an opengl compute shader written in GLSL, executing on a NVidia Geforce 970.</p>
  
  <p>At the start of the shader, a single invocation writes to a "Shader Storage Buffer Object" (SSBO).</p>
  
  <p>I then issue a suitable barrier, like memoryBarrier() in my GLSL.</p>
  
  <p>I then read from the memory written in the first step, in each invocation.</p>
  
  <p>Will that first write be visible to all invocations in the current compute operation?</p>
  
  <p>At <a href="https://www.khronos.org/opengl/wiki/Memory_Model#Ensuring_visibility" rel="nofollow noreferrer">https://www.khronos.org/opengl/wiki/Memory_Model#Ensuring_visibility</a> , Khronos say:</p>
  
  <p>"Use coherent and an appropriate memoryBarrier* or groupMemoryBarrier call if you use a mechanism like barrier to synchronize between invocations."</p>
  
  <p>I'm pretty sure it's possible to synchronize this way within a work group. But does it work for all invocations in every work group, in the entire compute operation?</p>
  
  <p>I'm unsure how an entire set of work groups is scheduled. I would expect them to possibly run sequentially, making the kind of synchronization I'm asking about impossible?</p>