Commit Graph

272 Commits

Author SHA1 Message Date
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
charles-lunarg
75ec283c37 Update to latest Vulkan-Headers 2022-11-08 11:02:57 -07:00
charles-lunarg
f46d329586 Update to latest Vulkan-Headers 2022-11-03 10:48:52 -06:00
Odilon Vatonne
6d0c3763cc Remove unused phys_dev parameter 2022-10-28 15:33:33 -06:00
Odilon Vatonne
262ba0a857 Move situational code to lambda at call site and remove unused parameter warning 2022-10-28 15:33:33 -06:00
Odilon Vatonne
d90ca8755f Remove format feature flag handling from SwapchainBuilder and more code comments
- format feature flags should not be used, as set_image_usage_flags is a better alternative
- split format search in two phases (desired / best)
- explain usage of is_unextended_present_mode for basic validation
2022-10-28 15:33:33 -06: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
706ffb6355 Change deafult composite alpha for Android
Android typically only supports the INHERIT bit. Easiest way to accomodate this
is to #ifdef ANDROID to use the INHERIT bit.
2022-10-10 09:55:35 -06:00
Charles Giessen
01de71738c Pass Image Usage flags into Swapchain
This allows the image views to be created with the same usage flags as
the swapchain. This necessitated passing in version information down
the object creation chain because to add the usage flags requires 1.1
to be enabled.
2022-10-08 13:12:02 -06:00
Charles Giessen
14e5a557f7 Format error to_string functions
Use CASE_TO_STRING macro to make the to_string functions simpler.
2022-10-08 13:12:02 -06:00
Charles Giessen
ab52ad97a8 Move Result & Error out of the detail namespace
Since its a part of the public interface, it means applications using vk-bootstrap
will inevitably need to use the types in error handling paths.
2022-10-08 13:12:02 -06:00
charles-lunarg
789a24edb7 Update to latest Vulkan-Headers 2022-10-04 21:19:32 -06:00
charles-lunarg
5b15f6e881 Update to latest Vulkan-Headers 2022-09-15 11:48:34 -06:00
David Dubois
1fea63645a Properly handle forward-declared structs 2022-08-28 12:13:08 -06:00
Matthew Pohlmann
00cf404e7b Fix typo 2022-07-28 13:48:15 -06:00
Matthew Pohlmann
8d9aea9987 Swapchain stores the VkColorSpaceKHR actually used when creating swapchains so users can query the final value 2022-07-28 13:48:15 -06:00
charles-lunarg
f8573e117c Update to latest Vulkan-Headers 2022-07-28 13:47:43 -06:00
Charles Giessen
aeed599098 Fix desired extensions not being enabled
Regression caused desired extensions to not be added to the device create info structure,
resulting in desired extensions not being enabled.
2022-07-16 11:49:26 -06:00
Matthew Pohlmann
80396093b4 Remove unnecessary explicit check for the partition index being physical_devices.end() 2022-07-07 22:10:26 -06:00
Matthew Pohlmann
97734970f0 Fix removal of unsuitable devices when using only_fully_suitable selection 2022-07-07 22:10:26 -06:00
charles-lunarg
e78a1822c1 Update to latest Vulkan-Headers 2022-07-05 11:19:16 -06:00
Yoan Lecoq
8251bdbeee Apply suggested changes for PR #138 2022-06-21 12:38:26 -06:00
Yoan Lecoq
31408e0b9e Add SwapchainBuilder::set_required_min_image_count(), following suggestions from PR #138 2022-06-21 12:38:26 -06:00
Yoan Lecoq
78ee4e67cd SwapchainBuilder: Remove use_default_min_image_count(), introduce BufferMode enum 2022-06-21 12:38:26 -06:00
Yoan
f528fe33d6 SwapchainBuilder::use_default_min_image_count(): fix default parameter specified in function definition 2022-06-21 12:38:26 -06:00
Yoan Lecoq
5ac2b21dfe SwapchainBuilder: provide some control over minImageCount 2022-06-21 12:38:26 -06:00
Charles Giessen
f847ab8566 Add exclusion list for alias in generator code
Some alias types are not pure promotional types, and need to be excluded from the
code which replaces types with their alias.

This may be a stopgap solution for a larger underlying problem of not being able to
determine if an alias is promoted or not.
2022-06-20 12:11:46 -06:00
charles-lunarg
fc880eb598 Update to latest Vulkan-Headers 2022-06-20 07:59:48 -06:00
Aelarion
b01b2b1d8e Fix #129 with correct desired_flags test 2022-06-09 12:48:48 -06:00
Yoan Lecoq
74cac40817 SwapchainBuilder: expose present_mode and requested_min_image_count in the resulting Swapchain 2022-05-17 10:34:01 -05:00
charles-lunarg
8f39b12431 Update to latest Vulkan-Headers 2022-05-17 10:32:56 -05:00
Nicholaus Clark
2912c74ebf Address review comments 2022-05-05 21:09:33 -06:00
Nicholaus Clark
adee12a0d9 Fix best practices warning when in VK 1.1 or higher 2022-05-05 21:09:33 -06:00
spnda
bf4e2f073b Fix: portability_enumeration flag was not available before 1.3.208 2022-05-02 12:08:56 -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
charles-lunarg
62c075c16b Update to latest Vulkan-Headers 2022-03-23 14:27:31 -06:00
Nicholaus Clark
4a2984ad68 Added pNext chain support for swapchain::get_image_views 2022-03-19 12:24:57 -06:00
Charles Giessen
65071da181 Enable VK_KHR_portability_subset if available
Makes it easy to use vulkan on macOS since vk-bootstrap will auto-enable it if
the extension is available.

This can be disabled by calling `disable_portability_subset`.
2022-03-01 21:17:10 -07:00
Charles Giessen
d3170c0657 Refactor physical device extension code to use std::string
Makes it harder for lifetime issues to appear since the extension strings are
owned by the PhysicalDevice class rather than assuming they are correct.
2022-03-01 21:17:10 -07: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
f4d3f916f1 Fix desire_api_version broken by previous commit 2022-02-27 13:46:15 -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
Danderaion
b7c2ddd8e5 Forward required/desired API versions to PhysicalDeviceBuilder
Desired version is called max_api_version, since valid Vulkan
program is not allowed to use features from any higher version.
2022-02-27 13:46:15 -07:00
Danderaion
0fa1dd8e20 Allow desiring higher api versions
Allows applications to desire_api_version that is
higher than available instance version.
2022-02-27 13:46:15 -07:00
forenoonwatch
b1b121efe0 Fix version macro not selecting VK_MAKE_VERSION
The version macro selector was looking for the constant VK_API_VERSION instead of the correct macro VK_MAKE_VERSION. Replaced the preprocessors accordingly.
2022-02-19 11:06:47 -07:00
sean
d299f782e6 Use own Vulkan version macros 2022-02-15 20:20:42 -07:00
Charles Giessen
1bbeaf2063 Add extensions in layers to main list
Allows apps to find all the extensions available. If they do not enable the layer the
extension comes from, the instance will fail creation due to missing the layer that
implements the extension.
2022-02-15 20:18:08 -07:00
Charles Giessen
7aef0dc1c1 Use reinterpret_cast in VkBootstrapDispatch.h 2022-02-05 20:43:22 -07:00
Charles Giessen
a1e58b4227 Fix autogen using wrong macro guards and types
The autogen accidentally took a reference instead of a copy, so all the aliases
were using the same data as the base type, leading to incorrect macro guards.

In addition, any aliased function would use the base funciton's types, leading
to incompatibilities when compiling with older headers. The chosen solution is
to always use the alias type if it exists.

Lastly, NVX was added to a blacklist, no functions from NVX extensions will be
generated, since they are experimental in nature.
2022-02-05 20:43:22 -07:00
Charles Giessen
d2898f822d Update vk-bootstrap to 1.3 2022-02-05 19:09:01 -07:00
Charles Giessen
99e92599c2 Add missing copy/move assignment operators to vkb::Result 2022-02-05 18:28:06 -07:00
Charles Giessen
eeffeff409 Make the list of device extensions to enable visible
Previously it was difficult to know which extensions were actually enabled.
If an app wanted to optionally enable certain extensions it was hard to know if
they got enabled.
2022-02-05 15:16:02 -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
sean
8c8694f441 Add InstanceBuilder functions for setting the different versions directly 2021-10-16 17:25:28 -06:00
sean
fb8a48779d Only add physical device properties 2 extension if using Vulkan 1.0 2021-10-13 15:34:53 -06:00
Vibi Manx
5140be1d4d Only fields need to be memset. 2021-09-10 22:54:17 -06:00
Vibi Manx
ad394dce69 Replaced reinterpret cast with memcpy in GenericFeaturesPNextNode. 2021-09-10 22:54:17 -06:00
spnda
f5f9b54f38 Add user-defined conversion operators 2021-09-10 14:29:40 -06:00
Charles Giessen
8922a41bd4 Fix a few nits 2021-08-09 01:10:13 -06:00
Charles Giessen
0408041547 Add brief documentation on which window extensions are used 2021-07-18 15:01:51 -06:00
Cody Goodson
c05a277572 Added noexcept and NDEBUG guard. 2021-06-16 10:52:07 -06:00
Cody Goodson
c66158e87c Small cleanup.
- Replaced GenericFeaturesPNextNode's set function with a template constructor.
- Moved validation asserts for extension feature structs into source.
- Dispatch table now generates in UTF-8.
2021-06-16 10:52:07 -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
244a44da51 Guard vkGetPhysicalDeviceFeatures2 behind instance version
Also make it so that instance extensions are queried in the instance only.
2021-06-10 10:06:14 -07:00
Charles Giessen
f422497cca Remove stray semicolon 2021-06-10 10:06:14 -07:00
Charles Giessen
05683f6b6b Call KHR version of get phys dev properties if necessary
Previously, vk-bootstrap didn't support calling vkGetPhyicalDeviceFeaturesKHR
on devices which support the extension. This makes vk-bootstrap more amenable
to 1.0 only hardware, like rasberry pi's.
2021-06-10 10:06:14 -07:00
Cody Goodson
f955777c8a Cleanup 2021-06-08 14:03:47 -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
7bd3fcae56 Make const. 2021-06-08 14:03:47 -07:00
Cody Goodson
0f307e06e8 Removed commented out lines. 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
Cody Goodson
87a63e942c Fixed a bug where user provided vkGetInstanceProcAddr pfn's were being ignored. Cleaned up un-needed locks. 2021-06-06 21:22:50 -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
2c0fe72ad9 Shorthand populated init 2021-06-06 12:49:23 -07:00
Cody Goodson
b963aeb94b Added populated function to gen and exception handling to vk.xml fetch. 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
dd1df1396c Forgot to remove const ref 2021-06-06 12:49:23 -07:00
Cody Goodson
63d252e828 Rework complete. 2021-06-06 12:49:23 -07:00
Cody Goodson
cd0959f37e Make proxys const. 2021-06-06 12:49:23 -07:00
Cody Goodson
85b17b40e7 Removed unneeded private. 2021-06-06 12:49:23 -07:00
Cody Goodson
03258bfab2 Simplified parsing text modifiers in proxy generation and fixed extension function proxys not being generated. 2021-06-06 12:49:23 -07:00
Cody Goodson
f091c5a4a4 Forgot to flag as const 2021-06-06 12:49:23 -07:00
Cody Goodson
5c5b8dad34 Cleanup + license/info. 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
Cody Goodson
d8c6fe42b8 Handling extensions + incorporating DispatchTable into main src
- which means rewriting almost the entire script..
2021-06-06 12:49:23 -07:00
Cody Goodson
a0a0738299 Header generation is working
- No loading yet
2021-06-06 12:49:23 -07:00
Yves BOYAdjian
a014a5a030 Right test in SystemInfo constructor 2021-06-04 13:28:35 -06:00
Charles Giessen
ab60522c9b Format internal queue selection functions 2021-05-21 14:04:28 -06:00
Charles Giessen
70265d8b29 Assert in SwapchainBuilder on queue getting failure
This resolves the TODO about what to do if the queues couldn't be found.
2021-05-21 14:04:28 -06:00
Charles Giessen
84ba7a79ee Document constructors for SwapchainBuilder
Specifically done for the 3rd constructor which will query the necessary
queues when they are not provided
2021-05-21 14:04:28 -06:00
Charles Giessen
045b1e7b0f Add queue selection tests and refactor internal code a bit 2021-05-21 14:04:28 -06:00
Charles Giessen
75db58ae8b Refactor GenericFeaturesPNextNode 2021-04-18 14:42:35 -06:00