title: Vulkan TOP/ BOTTOM OF PIPE and ALL_COMMANDS
body: <p>As a lot of "beginner", I thought use TOP_OF_PIPELINE as a dst and BOTTOM_OF_PIPELINE as a src meant ALL_COMMANDS for both.</p>
  
  <p><a href="https://github.com/KhronosGroup/Vulkan-Docs/issues/128#issuecomment-197475409" rel="nofollow noreferrer">Here</a> Nicol Bolas wrote that "Since top/bottom of the pipe make no sense for memory barriers, maybe using them should just be flat-out invalid. And thus useful only for execution barriers."</p>
  
  <p>From what I understand, since TOP and BOTTOM does not perform any access into memory, putting barrier on top or bottom can't make memory visible^^.</p>
  
  <p>As I understand what Nicol Bolas means and what I just said about memory access / visibility, when you use bottom or top, you must set accessMask to 0.</p>
  
  <p>If I want to present the image, I can do something like that :</p>
  
  <pre><code>srcStage = COLOR_ATTACHMENT_OUTPUT_BIT
  srcAccess = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
  oldLayout = ATTACHMENT_OPTIMAL
  dstStage = BOTTOM
  dstAccess = 0; // Since memory read access will be "issued" by semaphore
  newLayout = PRESENT_KHR;
  </code></pre>
  
  <p>We use bottom here because we do not want the memory barrier make the current queue wait as it is described in the specs :</p>
  
  <blockquote>
    <p>The VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT is useful for accomplishing memory barriers and layout transitions when the next accesses will be done in a different queue or by a presentation engine; in these cases subsequent commands in the same queue do not need to wait, but the barrier or transition must complete before semaphores associated with the batch signal.</p>
  </blockquote>
  
  <p>So now, I can say (I hope...) that I understand when to use every stages but TOP_OF_PIPE nop...</p>
  
  <p>So, there are my questions :
  What exactly is an execution barrier (thus without memory barrier)? Why are they useful? (because it is good to say that one operation happen after one other, but it is better to can say that we can consume the data produced in the first operation in the second operation).
  When should have I to put a barrier on Bottom or Top of pipeline?</p>
  
  <p>Thanks ! </p>