diff --git a/include/vkcv/SwapChain.hpp b/include/vkcv/SwapChain.hpp index d5d985ecc95db0c5f83b2a06ff514adb27f66c34..1d2f4710f7e363c9e5fe65d61781dd5922ba8d21 100644 --- a/include/vkcv/SwapChain.hpp +++ b/include/vkcv/SwapChain.hpp @@ -33,7 +33,7 @@ namespace vkcv { * @note The reference to our Swapchain variable is needed for the recreation step */ [[nodiscard]] - vk::SwapchainKHR getSwapchain(); + const vk::SwapchainKHR& getSwapchain() const; /** * gets the current surface object diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index c26f07757ed85c787d52bf355a80fa345f4e30fa..70f0425f79b99ddf0ff13a4a031aae28e1016976 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -343,7 +343,7 @@ namespace vkcv m_Queues.graphicsQueue.submit(submitInfo); vk::Result presentResult; - const vk::SwapchainKHR swapchain = m_swapchain.getSwapchain(); + const vk::SwapchainKHR& swapchain = m_swapchain.getSwapchain(); const vk::PresentInfoKHR presentInfo(1, &m_SyncResources.renderFinished, 1, &swapchain, &swapchainImageIndex, &presentResult); m_Queues.presentQueue.presentKHR(presentInfo); if (presentResult != vk::Result::eSuccess) { diff --git a/src/vkcv/SwapChain.cpp b/src/vkcv/SwapChain.cpp index 1a8cfb799585ed8b77b1dace12eebcc519ebd48f..3483ae37e718453a99d56d31e025433acb7f4422 100644 --- a/src/vkcv/SwapChain.cpp +++ b/src/vkcv/SwapChain.cpp @@ -6,7 +6,7 @@ namespace vkcv { : m_surface(surface), m_swapchain(swapchain), m_format( format), m_ImageCount(imageCount) {} - vk::SwapchainKHR SwapChain::getSwapchain() { + const vk::SwapchainKHR& SwapChain::getSwapchain() const { return m_swapchain; }