title: vkCreateSwapchainKHR: internal drawable creation failed
body: <p>I had my Vulkan application working but for some reason it stopped working(I don't believe I touched anything that could have broken it, besides making my engine project a .lib instead of a .dll) and started giving the "vkCreateSwapchainKHR: internal drawable creation failed" error in the validation layers. <code>vkCreateSwapchainKHR</code> returns <code>VK_ERROR_VALIDATION_FAILED_EXT</code>.</p>
  
  <p>I already checked this answer:
  <a href="https://stackoverflow.com/questions/41379529/wat-does-the-vkcreateswapchainkhrinternal-drawable-creation-failed-means">Wat does the &quot;vkCreateSwapchainKHR:internal drawable creation failed.&quot; means</a>, but it was not my problem, (as I said, it was working until it wasn't). Here's all the code I believe is relevant, if you need something else just comment:</p>
  
  <p>Window Creation:</p>
  
  <pre><code>/* Initialize the library */
  if (!glfwInit())
  
      /* Create a windowed mode window and its OpenGL context */
      glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
      glfwWindowHint(GLFW_DECORATED, _WCI.IsDecorated);
      GLFWWindow = glfwCreateWindow(Extent.Width, Extent.Height, _WCI.Name.c_str(), nullptr, nullptr);
  
      if (!GLFWWindow) glfwTerminate();
  
      //glfwMakeContextCurrent(GLFWWindow);
  
      uint32 Count = 0;
      auto ff = glfwGetRequiredInstanceExtensions(&amp;Count);
  
      GS_BASIC_LOG_MESSAGE("GLFW required extensions:")
      for (uint8 i = 0; i &lt; Count; ++i)
      {
          GS_BASIC_LOG_MESSAGE("%d: %s", i, ff[i]);
      }
  
      WindowObject = glfwGetWin32Window(GLFWWindow);
      WindowInstance = GetModuleHandle(nullptr);
  </code></pre>
  
  <p>I'm using the correct instance extensions:</p>
  
  <pre><code>const char* Extensions[] = { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WIN32_SURFACE_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_EXTENSION_NAME };
  </code></pre>
  
  <pre><code>VKSwapchainCreator VulkanRenderContext::CreateSwapchain(VKDevice* _Device, VkSwapchainKHR _OldSwapchain) const
  {
      VkSwapchainCreateInfoKHR SwapchainCreateInfo = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR };
  
      SwapchainCreateInfo.surface = Surface.GetHandle();
      SwapchainCreateInfo.minImageCount = 3;
      SwapchainCreateInfo.imageFormat = Format.format;
      SwapchainCreateInfo.imageColorSpace = Format.colorSpace;
      SwapchainCreateInfo.imageExtent = Extent2DToVkExtent2D(RenderExtent);
      //The imageArrayLayers specifies the amount of layers each image consists of. This is always 1 unless you are developing a stereoscopic 3D application.
      SwapchainCreateInfo.imageArrayLayers = 1;
      SwapchainCreateInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
      SwapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
      SwapchainCreateInfo.queueFamilyIndexCount = 0;
      SwapchainCreateInfo.pQueueFamilyIndices = nullptr;
      SwapchainCreateInfo.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
      SwapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
      SwapchainCreateInfo.presentMode = PresentMode;
      SwapchainCreateInfo.clipped = VK_TRUE;
      SwapchainCreateInfo.oldSwapchain = _OldSwapchain;
  
      return VKSwapchainCreator(_Device, &amp;SwapchainCreateInfo);
  }
  </code></pre>
  
  <p>Both <code>VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR</code> and <code>VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR</code> are supported by my GPU.</p>
  
  <pre><code>    VkBool32 Supports = 0;
      vkGetPhysicalDeviceSurfaceSupportKHR(_PD, PresentationQueue.GetQueueIndex(), _Surface, &amp;Supports);
  
      VkSurfaceCapabilitiesKHR SurfaceCapabilities = {};
      vkGetPhysicalDeviceSurfaceCapabilitiesKHR(_PD, _Surface, &amp;SurfaceCapabilities);
  
      VkBool32 Supported = 0;
      vkGetPhysicalDeviceSurfaceSupportKHR(_PD, PresentationQueue.GetQueueIndex(), _Surface, &amp;Supported);
  
      auto bb = vkGetPhysicalDeviceWin32PresentationSupportKHR(_PD, PresentationQueue.GetQueueIndex());
  </code></pre>
  
  <p>Everything here returns true, although it seemed suspicious to me that <code>VkSurfaceCapabilitiesKHR</code> returned the same extent for currentExtent, minImageExtent and maxImageExtent.</p>