Commit Graph

7 Commits

Author SHA1 Message Date
Charles Giessen
96688de170 Add vulkan-hpp tests
Since the API can accept vulkan-hpp types in a few places, it is good to have
tests for those places. While the current test suite isn't exhaustive, it is
enough to get the ball rolling.

This PR also refactors some of the 'setup' logic for the tests into a separate
file so that the hpp tests can make use of them.
2024-07-01 09:54:16 -05:00
Charles Giessen
c9d94287a5 Add enable_features_if_present to PhysicalDevice
Allows users to enable features if they are present, getting back a bool
telling them whether the feature is supported and will be enabled on the
device.

Also:
* Removes redundant VkPhysicalDeviceFeatures2 struct in vkb::PhysicalDevice.
* Adds test copying of details when creating a VkDevice so that test can check
what features were actually enabled on the device.
* Creates GenericFeatureChain struct for managing pNext chains.
* Allow multiple calls to set_require_features by combining the fields
2024-04-26 16:02:25 -06:00
Charles Giessen
a330227666 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.
2024-02-12 09:48:56 -06:00
Charles Giessen
348e8bf796 Support tests on windows with clang & clang-cl
Required adding a .def file to properly export the required symbols and
disabling pointer cast warnings that are coming from Catch2.
2023-12-06 14:07:18 -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
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
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