From f782eab9219d09c295c67e525edca738c43c8329 Mon Sep 17 00:00:00 2001 From: Dennis Tsiang Date: Tue, 27 Oct 2020 11:12:00 +0000 Subject: [PATCH] Fix failing assert in swapchain_base.cpp Erroneous assert was left in swapchain_base.cpp after some refactoring was done. This commit removes the assert and updates the CMakeLists.txt file to turn on compiler warnings so that developers can spot these leftover code earlier. Change-Id: I7f4051c89a86f21f66f20b0e92f01bc101436c71 Signed-off-by: Dennis Tsiang --- CMakeLists.txt | 2 +- wsi/swapchain_base.cpp | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fcb072..5fd1cd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(VULKAN_PKG_CONFIG vulkan) # Disable C++ exceptions. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -Wall") if(NOT DEFINED VULKAN_CXX_INCLUDE) set(VULKAN_CXX_INCLUDE ${VULKAN_PKG_CONFIG_INCLUDEDIR}) diff --git a/wsi/swapchain_base.cpp b/wsi/swapchain_base.cpp index 5ef1654..a35efcf 100644 --- a/wsi/swapchain_base.cpp +++ b/wsi/swapchain_base.cpp @@ -136,6 +136,7 @@ void swapchain_base::unpresent_image(uint32_t presented_index) swapchain_base::swapchain_base(layer::device_private_data &dev_data, const VkAllocationCallbacks *allocator) : m_device_data(dev_data) + , m_page_flip_thread_run(true) , m_thread_sem_defined(false) , m_first_present(true) , m_pending_buffer_pool{ nullptr, 0, 0, 0 } @@ -148,7 +149,6 @@ swapchain_base::swapchain_base(layer::device_private_data &dev_data, const VkAll , m_ancestor(VK_NULL_HANDLE) , m_device(VK_NULL_HANDLE) , m_queue(VK_NULL_HANDLE) - , m_page_flip_thread_run(true) { } @@ -283,13 +283,6 @@ VkResult swapchain_base::init(VkDevice device, const VkSwapchainCreateInfoKHR *s return result; } - /* Only programming error can cause this to fail. */ - assert(res == 0); - if (res != 0) - { - return VK_ERROR_OUT_OF_HOST_MEMORY; - } - res = sem_init(&m_start_present_semaphore, 0, 0); /* Only programming error can cause this to fail. */ assert(res == 0);