title: Surface format is B8G8R8A8_UNORM, but vkCmdClearColorImage takes float?
body: <p>I use <code>vkGetPhysicalDeviceSurfaceFormatsKHR</code> to get supported image formats for the swapchain, and (on Linux+Nvidia, using SDL) I get <code>VK_FORMAT_B8G8R8A8_UNORM</code> as the first option and I go ahead and create the swapchain with that format:</p>
  
  <pre><code>VkSwapchainCreateInfoKHR swapchain_info = {
      ...
      .imageFormat = format, /* taken from vkGetPhysicalDeviceSurfaceFormatsKHR */
      ...
  };
  </code></pre>
  
  <p>So far, it all makes sense. The image format used to draw on the screen is the usual 8-bits-per-channel BGRA.</p>
  
  <p>As part of my learning process, I have so far arrived at setting up a lot of stuff but not yet the graphics pipeline<sup>1</sup>. So I am trying the only command I can use that doesn't need a pipeline: <code>vkCmdClearColorImage</code><sup>2</sup>.</p>
  
  <p>The <code>VkClearColorValue</code> used to define the clear color can take the color as <code>float</code>, <code>uint32_t</code> or <code>int32_t</code>, depending on the format of the image. I would have expected, based on the image format given to the swapchain, that I should give it <code>uint32_t</code> values, but that doesn't seem to be correct. I know because the screen color didn't change. I tried giving it <code>float</code>s and it works.</p>
  
  <p>My question is, why does the clear color need to be specified in <code>float</code>s when the image format is <code>VK_FORMAT_B8G8R8A8_UNORM</code>?</p>
  
  <hr>
  
  <p><sup>1</sup> <sub>Actually I have, but thought I would try out the simpler case of no pipeline first. I'm trying to incrementally use Vulkan (given its verbosity) particularly because I'm also writing <a href="https://github.com/ShabbyX/vktut" rel="noreferrer">tutorials on it</a> as I learn.</sub></p>
  
  <p><sup>2</sup> <sub>Actually, it technically doesn't need a render pass, but I figured hey, I'm not using any pipeline stuff here, so let's try it without a pipeline and it worked.</sub></p>
  
  <hr>
  
  <p>My rendering loop is essentially the following:</p>
  
  <ul>
  <li>acquire image from swapchain</li>
  <li>create a command buffer with the following:
  
  <ul>
  <li>transition from <code>VK_IMAGE_LAYOUT_UNDEFINED</code> to <code>VK_IMAGE_LAYOUT_GENERAL</code> (because I'm clearing the image outside a render pass)</li>
  <li>clear the image</li>
  <li>transition from <code>VK_IMAGE_LAYOUT_GENERAL</code> to <code>VK_IMAGE_LAYOUT_PRESENT_SRC_KHR</code></li>
  </ul></li>
  <li>submit command buffer to queue (taking care of synchronization with swapchain with semaphores)</li>
  <li>submit for presentation</li>
  </ul>