Commit Graph

46 Commits

Author SHA1 Message Date
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
622e36a487 Small cleanup of tests 2023-12-02 11:32:03 -07: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
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
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
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
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
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
Odilon Vatonne
73295fed0b Revert behavior change with desired formats not being available 2022-10-28 15:33:33 -06:00
Odilon Vatonne
b9a98c61b3 Check image usage in SwapchainBuilder and stricter format feature verifications 2022-10-28 15:33:33 -06:00
Charles Giessen
c543dc104b Support VK_KHR_portability_enumeration
Also cleanup some warnings in the tests.
2022-04-25 18:34:44 -06:00
Nicholaus Clark
4a2984ad68 Added pNext chain support for swapchain::get_image_views 2022-03-19 12:24:57 -06:00
Charles Giessen
5f45b1019a Allow apps to query devices based on the name
This lets applications see all the devices which meet a set of requirements
then pick whichever of these devices is most appropriate for them. The intent
is for applications that want to find all the suitable devices and let the
user of the application pick the physical device from a list.
2022-03-01 21:17:10 -07:00
Danderaion
f6c262c3ab Add set_minimum_instance_version
Also deprecates InstanceBuilder::desire_api_version
and PhysicalDeviceSelector::set_desired_version
2022-02-27 13:46:15 -07:00
sean
d299f782e6 Use own Vulkan version macros 2022-02-15 20:20:42 -07:00
Charles Giessen
bd6a2e4311 Fix crashing when calling GetPhysDevFeaturesKHR
vk-bootstrap would attempt to call vkGetPhysDevFeaturesKHR without enabling
the appropriate extension first.
2021-12-31 11:38:07 -07:00
Charles Giessen
6bf383778b Don't pass an instance in for pre-instance functions.
A recent loader change results in NULL being returned for pre-instance functions
if the instance handle passed into vkGetInstanceProcAddr isn't NULL. This was
reverted but going forward this change will require updating applications.
2021-12-08 15:49:44 -07:00
spnda
f5f9b54f38 Add user-defined conversion operators 2021-09-10 14:29:40 -06:00
Charles Giessen
867376d01e Move debug callback into header and allow adding user pointer 2021-06-14 15:17:37 -07:00
Charles Giessen
e511dfdbf9 test: Add 1.0 test for feature config selection 2021-06-10 10:06:14 -07:00
Cody Goodson
f49032f804 Internal table change.
- Internal tables are now populated through internal vkGetDeviceProcAddr rather than through passed dispatch table
- Device now has its own internal table as well.
- Cleaned up get_proc_addr functions and removed internal functions that are now held in a types internal tables.
2021-06-08 14:03:47 -07:00
Cody Goodson
f5d3061043 Added optional dispatch table usage to swapchain. 2021-06-08 14:03:47 -07:00
Charles Giessen
b3fdd554b4 Add vkb::destroy_surface helper function 2021-06-06 13:25:08 -07:00
Cody Goodson
10d88ae840 Reverted back to dispatch table creation function in device type
- Added noexcept modifier to proxys
- Change name of header to VkBoostrapDispatch.h
2021-06-06 12:49:23 -07:00
Cody Goodson
a61e221d59 Trimmed branching in script and modified usage in core lib. 2021-06-06 12:49:23 -07:00
Cody Goodson
8dc3c2aeee Proxys added to autogen. Updated test. 2021-06-06 12:49:23 -07:00
Cody Goodson
2445eb0b28 Loading looks good, but requires passing Device still; 2021-06-06 12:49:23 -07:00
Charles Giessen
a0d1ce5b39 Revert "Revert "Simplified structures and plugged into existing logic.""
This reverts commit 2a352b5a25.
2021-04-18 14:42:35 -06:00
Charles Giessen
5c85f3a796 Revert "Revert "Fixed Features11/12 break. Tests now pass.""
This reverts commit 299b36a3a4.
2021-04-18 14:42:35 -06:00
Charles Giessen
8a3c1ac6ed Revert "Revert "- Restored removed functions - Restored pNext chain to device (appends to the end of the ExtentionFeatures chain) - Style changes - Migrated ExtensionFeatures into detail""
This reverts commit 4bfc21f8be.
2021-04-18 14:42:35 -06:00
Charles Giessen
4bfc21f8be Revert "- Restored removed functions - Restored pNext chain to device (appends to the end of the ExtentionFeatures chain) - Style changes - Migrated ExtensionFeatures into detail"
This reverts commit 0359ceb3fb.
2021-04-18 14:09:56 -06:00
Charles Giessen
299b36a3a4 Revert "Fixed Features11/12 break. Tests now pass."
This reverts commit 632a42f5cd.
2021-04-18 14:09:56 -06:00
Charles Giessen
2a352b5a25 Revert "Simplified structures and plugged into existing logic."
This reverts commit 6ee81abdd3.
2021-04-18 14:09:56 -06:00
Cody Goodson
6ee81abdd3 Simplified structures and plugged into existing logic. 2021-04-18 14:04:27 -06:00
vibi-manx
632a42f5cd Fixed Features11/12 break. Tests now pass. 2021-04-18 14:04:27 -06:00
vibi-manx
0359ceb3fb - Restored removed functions
- Restored pNext chain to device (appends to the end of the ExtentionFeatures chain)
- Style changes
- Migrated ExtensionFeatures into detail
2021-04-18 14:04:27 -06:00
Charles Giessen
151c76d1cc Add selection by and enableing 1.1 and 1.2 features.
Users can now ask for physical devices which support a specific 1.1 and 1.2
feature. VkBootstrap will then add the selected features to the enable list
in device creation.
2021-03-29 13:23:27 -06:00
Charles Giessen
0c29d98362 cmake: Don't require vulkan in order to build
find_package is used to try to find the Vulkan-Headers, and if they aren't
present, it downloads them with fetch content. This way users don't need
vulkan 'installed' on their system, specifically for windows users.

It also changes the tests to load all the necessary function pointers, that
 way we don't need to find the vulkan loader to build the tests.
2021-03-02 09:11:23 -07:00
Charles Giessen
947afe55c0 Add default gotten queues test for swapchain builder 2020-10-26 13:21:59 -06:00
Charles Giessen
6e50441f41 Re-added swapchain constructors from individual handles.
Allows people to use Swapchain Builder withtout holding onto the vkb::Device
handle. Also made patch levels optional since they generally don't matter.
2020-10-21 13:25:48 -06:00
Charles Giessen
812ce2cf0a Dynamically load vulkan instead of statically link.
Make vk-bootstrap capable of loading the vulkan runtime and not need to
link against the library. This improves the usability of vk-bootstrap since
now you don't need the vulkan library on your system to build.

This commit also changes how SystemInfo works so as to allow the dynamic
vulkan loading.
2020-08-10 23:38:26 -06:00
Charles Giessen
8a053cadc3 Polished SwapchainBuilder. Redid swapchain recreation.
To recreate a swapchain now requires making a new SwapchainBuilder or
keeping the old one around. Removed the recreate function since its
purpose was unclear. Introduced set_old_swapchain to allow recyling the
old swapchain. Updated documentation and getting started guide.
2020-06-08 14:28:32 -06:00
Charles Giessen
a806c367f3 Added window titles for tests 2020-05-19 11:10:50 -06:00
Lesley Lai
df53490ede Error handling with std::error_code 2020-05-17 09:19:12 -06:00