title: vulkan vkQueuePresentKHR spend a lot of time?
body: <p>I want to test how long vkQueuePresentKHR will take. But I found a strange thing. 
  The testing <strong>shader</strong> is a filter, it like this (please omit scrawling area in her face ^^):
  <a href="https://i.stack.imgur.com/kcYJK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kcYJK.png" alt="enter image description here"></a></p>
  
  <p>My testing <a href="https://github.com/lbknxy/vulkan_log/blob/master/code.cpp" rel="nofollow noreferrer">code</a> .</p>
  
  <pre><code>...
  long vSubmitE = MGetCurTimeStamp();
  ....
  result = vkQueuePresentKHR(graphicsQueue, &amp;presentInfo);
  // present end time
  long vPresentE = MGetCurTimeStamp();
  
  // log time of vkQueuePresentKHR  had spent...
  LOGE("vpresent time = %d ms", vPresentE - vSubmitE);
  </code></pre>
  
  <p>device : nexus6p . GPU : Adreno (TM) 430 . PresentMode : mailbox . swapchain imageCount = 4.</p>
  
  <p>At first the time is very good :<a href="https://github.com/lbknxy/vulkan_log/blob/master/vpresent_FIFO_.log" rel="nofollow noreferrer">file1</a>
  <a href="https://i.stack.imgur.com/iZyQ3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iZyQ3.png" alt="enter image description here"></a></p>
  
  <p>Then worse :<a href="https://github.com/lbknxy/vulkan_log/blob/master/vpresent_FIFO_.log" rel="nofollow noreferrer">file1</a>
  <a href="https://i.stack.imgur.com/HzoJi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HzoJi.png" alt="enter image description here"></a></p>
  
  <p>Over a peroid of time, I run this application again, then I can not beleive my own eyes :<a href="https://github.com/lbknxy/vulkan_log/blob/master/five.log" rel="nofollow noreferrer">file2</a></p>
  
  <p><a href="https://i.stack.imgur.com/cU4D8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cU4D8.png" alt="enter image description here"></a></p>
  
  <p>I don't know how to explain this , because I feel it's very weird. Please help or try to give some idea how to explain this phenomenon.</p>
  
  <p>Today, I add vkQueueWaitIdle(queue) to synchronize vkQueuePresentKHR, waiting and  recording stop time until operations in queue have been finished.This time , I change VkPresent to FIFO.</p>
  
  <p>It likes this :</p>
  
  <pre><code>...
  long vSubmitE = MGetCurTimeStamp();
  ....
  result = vkQueuePresentKHR(graphicsQueue, &amp;presentInfo);
  
  // wait until back from gpu.
  vkQueueWaitIdle(graphicsQueue);
  
  // present end time
  long vPresentE = MGetCurTimeStamp();
  
  // log time of vkQueuePresentKHR  had spent...
  LOGE("vpresent time = %d ms", vPresentE - vSubmitE);
  </code></pre>
  
  <p>After ten minutes , I got this :<a href="https://github.com/lbknxy/vulkan_log/blob/master/syncVul.log" rel="nofollow noreferrer">full file</a></p>
  
  <pre><code>...
  11-23 15:29:09.690  vpresent time = 25 ms
  11-23 15:29:09.742  vpresent time = 25 ms
  11-23 15:29:09.815  vpresent time = 24 ms
  11-23 15:29:09.913  vpresent time = 24 ms
  11-23 15:29:09.941  vpresent time = 24 ms
  11-23 15:29:10.116  vpresent time = 25 ms
  11-23 15:29:10.190  vpresent time = 25 ms
  11-23 15:29:10.242  vpresent time = 25 ms
  11-23 15:29:10.276  vpresent time = 24 ms
  11-23 15:29:10.654  vpresent time = 25 ms
  11-23 15:29:10.855  vpresent time = 25 ms
  11-23 15:29:10.936  vpresent time = 25 ms
  11-23 15:29:11.217  vpresent time = 25 ms
  11-23 15:29:11.290  vpresent time = 56 ms
  11-23 15:29:11.383  vpresent time = 40 ms
  11-23 15:29:11.427  vpresent time = 40 ms
  11-23 15:29:11.516  vpresent time = 40 ms
  11-23 15:29:11.561  vpresent time = 41 ms
  11-23 15:29:11.606  vpresent time = 40 ms
  11-23 15:29:11.743  vpresent time = 41 ms
  11-23 15:29:11.830  vpresent time = 40 ms
  11-23 15:29:11.965  vpresent time = 40 ms
  11-23 15:29:12.097  vpresent time = 41 ms
  11-23 15:29:12.142  vpresent time = 41 ms
  11-23 15:29:12.277  vpresent time = 40 ms
  ...
  </code></pre>
  
  <p><strong>Still unbelievable</strong> !</p>