Commit Graph

393 Commits

Author SHA1 Message Date
Charles Giessen
767bd1baf2 Fixup Clang on windows support
This commit fixes issues that prevented clang-cl & clang from being distinguished
on windows, resulting in improper command line arguments being used.

CMAKE_CXX_COMPILER_FRONTEND_VARIANT is the proper way to distinguish clang from
clang-cl, which have different command line options.
2023-12-06 14:07:18 -07:00
charles-lunarg
e2e2d69785 Update to latest Vulkan-Headers 2023-12-04 17:44:05 -07:00
Charles Giessen
f223c8d5ae Cleanup CMake finding of Vulkan & installation code
Adds extensive integration tests that exercise the various ways of finding
the Vulkan-Headers.

vk-bootstrap should now use the Vulkan-Headers or Vulkan::Headers targets if
they were already defined (such as is the case of FetchContent), and will
look for the VulkanHeaders package and Vulkan package as a fallback, and will
FetchContent Vulkan-Headers directly if that fails.

This should make integration seamless with the various ways vulkan-headers
is acquired.

The vk-bootstrap-vulkan-headers target was dropped in favor of directly
linking to Vulkan-Headers (creating a target by that name if none exists).
2023-12-02 19:49:54 -07:00
Charles Giessen
34be5eb2c5 Update to GLFW 3.3.8 in example code 2023-12-02 19:49:54 -07:00
Charles Giessen
622e36a487 Small cleanup of tests 2023-12-02 11:32:03 -07:00
Charles Giessen
6ab5669064 Workaround breaking API change in vkGetLatencyTimingsNV
The API of vkGetLatencyTimingsNV changed, which causes compilation failure due to
the generated code using the newer API while the Vulkan-Headers may be for the old
API.

The fix is to just disable the function if the headers are too old. While this does
limit the usage, because its from a new extension, there shouldn't be a huge impact.
2023-11-29 14:20:10 -07:00
Charles Giessen
e5dd024a51 Add version in tag description 2023-11-28 13:37:30 -07:00
Charles Giessen
03ac201309 Fix bugs in create_tag.yml
Forgot to checkout the repo and didn't have the correct path to a file.
2023-11-28 13:35:32 -07:00
Charles Giessen
a1471b414f Add workflow to tag header updates
Workflow is triggered manually in order to allow for me to review the PR first.
2023-11-28 14:31:14 -06:00
charles-lunarg
9f613c2348 Update to latest Vulkan-Headers 2023-11-28 13:55:07 -06:00
Charles Giessen
7900b9afe7 Add size + ptr & vector overloads for add_extensions
The instance & physical device selector only allowed adding a single
extension at a time. This commit adds overloads for a vector of const
char*'s and a count + pointer pair.
2023-11-22 03:00:44 -07:00
charles-lunarg
d4295cf688 Update to latest Vulkan-Headers 2023-11-18 11:39:44 -07:00
Charles Giessen
9864d2b838 Cleanup internal class VulkanFunctions
Removes the subclassing of VulkanLibrary, bringing its logic into the VulkanFunctions
class. This resolves a weird linking issue which was causing hot-reloading of shared
libraries that statically linked vk-bootstrap to fail to unload correctly, preventing
reloading.
The commit also consolidates the logic in load_vulkan_funcs() into a single function
rather than having it be split in three, which only made the code harder to reason
about.

Also made vk-bootstrap look for `libMoltenVK.dylib` on apple platforms, in case the
application only has the MoltenVK shared library but not the loader (and the user
didn't manually load GetInstanceProcAddr from MoltenVK then give it to vk-bootstrap).
2023-11-12 19:51:48 -07:00
Charles Giessen
49491c28c7 Remove deprecation notice in SwapchainBuilder
Turns out that was me being over eager in removing anything with 'desire' in the
name, and that for Swapchains there is a direct way to see the properties of the
swapchain after its creation, as vkb::Swapchain contains image count, colorspace,
present mode, and many other properties.
2023-10-30 11:53:33 -06:00
Charles Giessen
2b07f01a15 Mark QUEUE_INDEX_MAX_VALUE as inline
Fixes issues putting VkBootstrap.h into modules.
2023-10-30 11:50:10 -06:00
Charles Giessen
a1a0aba737 Update C++ minimum to 17 2023-10-30 11:43:57 -06:00
Charles Giessen
d2bc688552 Fix wrong parameter in Wayland function
Generator script was missing a case - causing incorrect code gen resulting in a
compiler errror for wayland.
2023-10-30 11:31:11 -06:00
Charles Giessen
ed31a4d1b1 Fix missing return *this in Result class 2023-10-30 11:13:12 -06:00
charles-lunarg
99be60aa19 Update to latest Vulkan-Headers 2023-10-23 18:50:54 -06:00
Charles Giessen
9e36810a48 Add enable_extension_if_present to vkb::PhysicalDevice
If the given extension is present, enable_extension_if_present will make
the extension be enabled on the device.

This fixes a gap in capability due to the deprecation of add_desired_extension.
2023-10-23 10:05:39 -06:00
Charles Giessen
f9717f66bb Add PhysicalDevice::is_extension_present()
Convenience function to check if a given extension would be enabled on the
physical device.
2023-10-22 10:30:18 -06:00
Charles Giessen
454fb23d52 Add padding to DispatchTables for undefined functions
This allows for a project with not-perfect use of macro defines across the
code base to not have different definitions for the dispatch tables.

For example:
```
    PFN_vkCreateAndroidSurfaceKHR fp_vkCreateAndroidSurfaceKHR = nullptr;
    void * fp_vkCreateAndroidSurfaceKHR{};
```
If VK_KHR_android_surface is not defined for whatever reason, the dispatch
table is still the same size, so other functions aren't affected.
2023-10-13 11:29:06 -06:00
Charles Giessen
72ba6954c9 Update to v1.3.268 & switch to spaces in VkBootstrapDispatch.h 2023-10-13 11:29:06 -06:00
Charles Giessen
09a220f026 Add deprecation notice to "desired" requests
The ability to request that some physical device or swapchain has certain features
but not require said features leads to confusion due to users having to manually
check if any desired request succeeded or not. Thus, this feature is being
deprecated, with eventual removal in the future.
2023-10-13 11:28:21 -06:00
charles-lunarg
6be9ef9f46 Update to latest Vulkan-Headers 2023-10-09 18:46:37 -06:00
Charles Giessen
be0df09b3a Update CMake minimum to 3.15
The Vulkan-Headers has a minimum of 3.15, and there is no great reason
to stay on such an old CMake version.
2023-10-09 13:24:09 -06:00
Charles Giessen
1ab85e9e55 Run tests in CI scripts
Make use of CTest to manage running tests, and configure the project to
allow Catch2 to work with CTest
2023-10-09 13:24:09 -06:00
Nicholaus Clark
834960e58f Fix API of CustomQueueDescription 2023-10-09 11:52:18 -06:00
Charles Giessen
d759d3d575 Add VulkanMock for isolating tests from system
Allows the tests to set the exact values vk-bootstrap will receieve
rather than require a real vulkan driver to be present on the system.

This is done by creating a `vulkan-1.dll` on windows that implements
all of the API functions, and on linux/macOS intercepts `dlsym` to
make it return the mock's functions.
2023-10-03 14:26:25 -06:00
Charles Giessen
5e351fcdf8
Update run_autogen.yml to use main branch
Forgot to update this when changing the repo default from master to main.
2023-10-02 19:19:59 -06:00
Charles Giessen
f6006041c6 Mark vk-bootstrap as static & cleanup CMake
Marks the main vk-bootstrap library as a static library.

Removes unnecessary code, adds a language & description to the project
field.
2023-09-24 18:55:32 -06:00
Charles Giessen
83ef1035bf Add the Instance dispatch table
While not designed to be called by the user, it is common for other libraries to need
function pointers, including instance level functions.
2023-09-24 18:45:20 -06:00
Charles Giessen
fd71b1dd82 Use spaces instead of tabs
Modify the .clang-format to format with spaces for indention instead of tabs
2023-09-19 16:13:11 -06:00
Charles Giessen
04ec13b48d Update to latest headers & fix errors & cleanup generation script
VulkanSC was added to vk.xml and broke the generation script. This was an
easy fix, just needed to specify which API the version information should
use. Still, took the time to cleanup the code by running pylint and fixing
anything it warned about.
2023-09-19 15:52:27 -06:00
David Dubois
61f77612c7 Remove cringe whitespace 2023-02-28 16:57:17 -07:00
David Dubois
a4d4e0690e Remove new method, change debug utils enabling logic 2023-02-28 16:57:17 -07:00
David Dubois
82b7a0ed01 Provide a way to disable the debug callback 2023-02-28 16:57:17 -07:00
David Dubois
683d014241 Provide a way to disable the debug callback 2023-02-28 16:57:17 -07:00
charles-lunarg
2d7315eadf Update to latest Vulkan-Headers 2023-02-15 10:30:57 -07:00
Dani Camba
125652c9c6 fixed copypasted description of the option 2023-02-15 10:29:42 -07:00
Dani Camba
a5036f2368 add cmake options to hide warnings if is not main project 2023-02-15 10:29:42 -07:00
Charles Giessen
8e61b2d81c Make Vulkan 1.1 Headers required
Previously, the code tried to make it possible to use vk-bootstrap with
Vulkan 1.0 headers. This makes the code complicated and left several paths
completly untested. Making Vulkan 1.1 headers allows for simpler code.

Note: This does NOT make a Vulkan 1.1 capable driver required to use
vk-bootstrap. This only requires that the headers used to build
vk-bootstrap are 1.1 or above.
2023-01-12 16:07:43 -07:00
Charles Giessen
932b7794ac Refactor how GetPhysDevFeats2 works
Cleaned up the logic for handling when to use the core, the KHR, and when
not to use vkGetPhysicalDeviceFeatures2. This should make the logic easier
to follow with better names, and handle a few cases that were wrong, like
not caring if the extension is enabled by vulkan 1.1 is not.
2023-01-12 16:07:43 -07:00
Charles Giessen
0c459dca6f Add new error condition for DeviceBuilder
If an application uses add_required_extension_features but also adds
a VkPhysicalDeviceFeatures2 to the pNext chain of VkDeviceCreateInfo,
this will now result in an error. The reason is that Vk-Bootstrap is
perfectly capable of adding VkPhysicalDeviceFeatures to the pNext
chain itself but only if the user didn't already add their own.
2023-01-12 16:07:43 -07:00
Charles Giessen
9b3e648141 Tests: add missing swapchain destruction
In the swapchain recreation tests, the tests forgot to clean up the old
swapchains.
2023-01-12 16:07:43 -07:00
Charles Giessen
b36ede0f36 Handle multiple required extensions in generator
The XML added requirements which had multiple extensions be required.
This broke the existing autogen because it assumed there would only
be one extension required at a time. The fix is easy, split the
requirement string into a list then add it to the list of requirements.
2023-01-12 16:02:46 -07:00
charles-lunarg
833d07f5f9 Update to latest Vulkan-Headers 2023-01-12 15:57:05 -07:00
rogmatic
4462c56349 Fix graphics/present queue assignment
Fixed SwapchainBuilder second constructor, which had 'info.graphics_queue_index = present.value()' and 'info.present_queue_index = graphics.value()'.
2023-01-09 11:39:37 -07:00
Charles Giessen
b4b177170e Revert "Update to latest Vulkan-Headers"
This reverts commit 679bc1970f.
2022-12-28 16:27:03 -07:00
charles-lunarg
679bc1970f Update to latest Vulkan-Headers 2022-12-28 16:22:08 -07:00