From a3302276665041b9cc968d50d4e84679985bb203 Mon Sep 17 00:00:00 2001 From: Charles Giessen Date: Sun, 11 Feb 2024 12:48:55 -0600 Subject: [PATCH] Use vulkan/vulkan_core.h instead of vulkan/vulkan.h vulkan.h includes platform specific headers that cause non trivial build overhead. Because vk-bootstrap doesn't make use of any platform specific API's, it can move over to vulkan_core.h. This *MAY* break users of the library who were depending on vulkan/vulkan.h including other headers, like windows.h. But because the benefits outweigh the drawbacks, it is a good change. --- example/triangle.cpp | 2 +- script/generate_dispatch.py | 2 +- src/VkBootstrap.h | 2 +- src/VkBootstrapDispatch.h | 2 +- tests/vulkan_mock.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example/triangle.cpp b/example/triangle.cpp index 63d0c95..593628d 100644 --- a/example/triangle.cpp +++ b/example/triangle.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include diff --git a/script/generate_dispatch.py b/script/generate_dispatch.py index c1d5df3..beccde6 100644 --- a/script/generate_dispatch.py +++ b/script/generate_dispatch.py @@ -262,7 +262,7 @@ info = '// This file is a part of VkBootstrap\n' info += '// https://github.com/charles-lunarg/vk-bootstrap\n\n' # # Content -head = '\n#pragma once\n\n#include \n\n' +head = '\n#pragma once\n\n#include \n\n' head += 'namespace vkb {\n\n' def create_dispatch_table(dispatch_type): diff --git a/src/VkBootstrap.h b/src/VkBootstrap.h index a9f3c34..80a07ef 100644 --- a/src/VkBootstrap.h +++ b/src/VkBootstrap.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include "VkBootstrapDispatch.h" diff --git a/src/VkBootstrapDispatch.h b/src/VkBootstrapDispatch.h index f0f3221..dd3ec37 100644 --- a/src/VkBootstrapDispatch.h +++ b/src/VkBootstrapDispatch.h @@ -21,7 +21,7 @@ #pragma once -#include +#include namespace vkb { diff --git a/tests/vulkan_mock.hpp b/tests/vulkan_mock.hpp index 52a1b47..f4fbde7 100644 --- a/tests/vulkan_mock.hpp +++ b/tests/vulkan_mock.hpp @@ -8,7 +8,7 @@ #include #include -#include +#include // Helper function to get the size of a struct given a VkStructureType // Hand written, must be updated to include any used struct.