From 6933882f631c58878ccfba789a66ba4382b0e439 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Thu, 27 Feb 2020 20:58:38 -0700 Subject: [PATCH] Got vk-bootstrap compiling on Windows and fixed class/struct inconsistency --- CMakeLists.txt | 8 ++++++-- ext/glfw | 2 +- src/VkBootstrap.h | 14 +++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a224e2..03e0302 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ add_library(vk-bootstrap src/VkBootstrap.h src/VkBootstrap.cpp) target_include_directories(vk-bootstrap PUBLIC src) -target_include_directories(vk-bootstrap PRIVATE ${Vulkan_INCLUDE_DIRS}) -target_link_libraries(vk-bootstrap PRIVATE ${Vulkan_LIBRARIES}) +target_include_directories(vk-bootstrap PUBLIC ${Vulkan_INCLUDE_DIR}) +target_link_libraries(vk-bootstrap PUBLIC ${Vulkan_LIBRARY}) target_compile_features(vk-bootstrap PUBLIC cxx_std_11) @@ -16,6 +16,10 @@ option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF) if (VK_BOOTSTRAP_TEST) +set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) +set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) +set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) add_subdirectory(ext/glfw) add_subdirectory(ext/Catch2) diff --git a/ext/glfw b/ext/glfw index d973acc..0ac0133 160000 --- a/ext/glfw +++ b/ext/glfw @@ -1 +1 @@ -Subproject commit d973acc123826666ecc9e6fd475682e3d84c54a6 +Subproject commit 0ac013381be83fcd6e53ea874f09b1895943bd9e diff --git a/src/VkBootstrap.h b/src/VkBootstrap.h index cdbb543..d571464 100644 --- a/src/VkBootstrap.h +++ b/src/VkBootstrap.h @@ -144,7 +144,7 @@ class InstanceBuilder { InstanceBuilder& check_and_add_layer (const char* layer_name); // Adds a layer to be enabled. Will fail to create an instance if the layer isn't available. InstanceBuilder& must_enable_layer (const char* layer_name); - // Enables the specified extension if it is avaiable. + // Enables the specified extension if it is available. InstanceBuilder& check_and_add_extension (const char* extension_name); // Adds an extension to be enabled. Will fail to create an instance if the extension isn't available. InstanceBuilder& must_enable_extension (const char* extension_name); @@ -266,7 +266,7 @@ struct PhysicalDevice { }; enum class PreferredDeviceType { discrete, integrated, virtual_gpu, cpu, dont_care }; -struct PhysicalDeviceSelector { +class PhysicalDeviceSelector { public: // Requires a vkb::Instance to construct, needed to pass instance creation info. PhysicalDeviceSelector (Instance const& instance); @@ -390,10 +390,10 @@ class DeviceBuilder { detail::Expected> build (); - bool has_dedicated_compute_queue(); - bool has_distinct_compute_queue(); - bool has_dedicated_transfer_queue(); - bool has_distinct_transfer_queue(); + bool has_dedicated_compute_queue (); + bool has_distinct_compute_queue (); + bool has_dedicated_transfer_queue (); + bool has_distinct_transfer_queue (); // Require a queue family that supports compute operations but not graphics nor transfer. DeviceBuilder& request_dedicated_compute_queue (bool compute = true); @@ -406,7 +406,7 @@ class DeviceBuilder { DeviceBuilder& request_distinct_transfer_queue (bool transfer = true); // For Advanced Users: specify the exact list of VkDeviceQueueCreateInfo's needed for the application. - // If a custom queue setup is provided, getting the queues and queue indexes is up to the applicatoin. + // If a custom queue setup is provided, getting the queues and queue indexes is up to the application. DeviceBuilder& custom_queue_setup (std::vector queue_descriptions); // For Advanced Users: Add a structure to the pNext chain of VkDeviceCreateInfo.