title: How to update texture for every frame in vulkan?
body: <p>As my question title says, I want update texture for every frame. </p>
  
  <p>I got an idea :
  create a <code>VkImage</code> as a texture buffer with bellow configurations :<br>
   <code>initialLayout = VK_IMAGE_LAYOUT_PREINITIALIZED</code><br>
  <code>usage= VK_IMAGE_USAGE_SAMPLED_BIT</code></p>
  
  <p>and it's memory type is <code>VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT</code></p>
  
  <h1>In draw loop :</h1>
  
  <h3>first frame :</h3>
  
  <ol>
  <li>map texure data to <code>VkImage</code>(use <code>vkMapMemory</code>).  </li>
  <li>change <code>VkImage</code> layout from <code>VK_IMAGE_LAYOUT_PREINITIALIZED</code> to <code>VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL</code>.   </li>
  <li>use this <code>VkImage</code> as texture buffer.</li>
  </ol>
  
  <h3>second frame:</h3>
  
  <p>The layout will be <code>VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL</code> after the first frame , can I map next texure data to this <code>VkImage</code> directly without change it's layout ? if I can not do that, which layout can I change this <code>VkImage</code> to ?      </p>
  
  <p>In vkspec 11.4 it says :     </p>
  
  <blockquote>
    <p>The new layout used in a
    transition must not be VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED </p>
  </blockquote>
  
  <p>So , I can not change layout back to <code>_PREINITIALIZED</code> .<br>
  Any help will be appreciated.</p>