diff --git a/samples/05_InitSwapchain/05_InitSwapchain.cpp b/samples/05_InitSwapchain/05_InitSwapchain.cpp index 62b768c..9f87ffc 100644 --- a/samples/05_InitSwapchain/05_InitSwapchain.cpp +++ b/samples/05_InitSwapchain/05_InitSwapchain.cpp @@ -44,9 +44,9 @@ int main(int /*argc*/, char ** /*argv*/) vk::UniqueSurfaceKHR surface; { VkSurfaceKHR _surface; - glfwCreateWindowSurface(instance.get(), window.handle, nullptr, &_surface); + glfwCreateWindowSurface(VkInstance(instance.get()), window.handle, nullptr, &_surface); vk::ObjectDestroy _deleter(instance.get()); - surface = vk::UniqueSurfaceKHR(_surface, _deleter); + surface = vk::UniqueSurfaceKHR(vk::SurfaceKHR(_surface), _deleter); } // determine a queueFamilyIndex that suports present diff --git a/samples/RayTracing/RayTracing.cpp b/samples/RayTracing/RayTracing.cpp index 444c549..81fb78c 100644 --- a/samples/RayTracing/RayTracing.cpp +++ b/samples/RayTracing/RayTracing.cpp @@ -656,7 +656,7 @@ int main(int /*argc*/, char** /*argv*/) // Create Window Surface (using glfw) vk::SurfaceKHR surface; - VkResult err = glfwCreateWindowSurface(*instance, window, nullptr, reinterpret_cast(&surface)); + VkResult err = glfwCreateWindowSurface(VkInstance(*instance), window, nullptr, reinterpret_cast(&surface)); check_vk_result(err); std::pair graphicsAndPresentQueueFamilyIndex = vk::su::findGraphicsAndPresentQueueFamilyIndex(physicalDevice, surface); @@ -1063,7 +1063,7 @@ int main(int /*argc*/, char** /*argv*/) // Cleanup device->waitIdle(); swapChainData.swapChain.reset(); // need to reset swapChain before destroying the surface ! - VULKAN_HPP_DEFAULT_DISPATCHER.vkDestroySurfaceKHR(*instance, surface, nullptr); + VULKAN_HPP_DEFAULT_DISPATCHER.vkDestroySurfaceKHR(VkInstance(*instance), VkSurfaceKHR(surface), nullptr); glfwDestroyWindow(window); glfwTerminate(); } diff --git a/samples/utils/utils.cpp b/samples/utils/utils.cpp index 47ff20c..e936e71 100644 --- a/samples/utils/utils.cpp +++ b/samples/utils/utils.cpp @@ -671,11 +671,11 @@ namespace vk , window(vk::su::createWindow(windowName, extent)) { VkSurfaceKHR _surface; - VkResult err = glfwCreateWindowSurface(instance.get(), window.handle, nullptr, &_surface); + VkResult err = glfwCreateWindowSurface(VkInstance(instance.get()), window.handle, nullptr, &_surface); if (err != VK_SUCCESS) throw std::runtime_error("Failed to create window!"); vk::ObjectDestroy _deleter(instance.get()); - surface = vk::UniqueSurfaceKHR(_surface, _deleter); + surface = vk::UniqueSurfaceKHR(vk::SurfaceKHR(_surface), _deleter); } SwapChainData::SwapChainData(vk::PhysicalDevice const& physicalDevice, vk::UniqueDevice const& device, vk::SurfaceKHR const& surface, vk::Extent2D const& extent, vk::ImageUsageFlags usage,