From b53fd190b4ba61099526878e684687f23333aca7 Mon Sep 17 00:00:00 2001 From: Tobias Frisch <tfrisch@uni-koblenz.de> Date: Sun, 16 May 2021 19:29:15 +0200 Subject: [PATCH] Some changes to weaken MS-soft Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de> --- include/vkcv/SwapChain.hpp | 2 +- src/vkcv/Core.cpp | 2 +- src/vkcv/SwapChain.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/vkcv/SwapChain.hpp b/include/vkcv/SwapChain.hpp index d5d985ec..1d2f4710 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 c26f0775..70f0425f 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 1a8cfb79..3483ae37 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; } -- GitLab