Commit Graph

286 Commits

Author SHA1 Message Date
charles-lunarg
dc40c04232 Update to latest Vulkan-Headers 2024-10-29 08:56:11 -06:00
Charles Giessen
7fcd5d04c4 Add AMDX functions to header version workaround list
Header update 1.3.298 changed the definition of functions. Should have caught
this during the PR review, as well better late than never.
2024-10-22 11:50:58 -06:00
charles-lunarg
01018f5ba8 Update to latest Vulkan-Headers 2024-10-22 10:12:03 -06:00
charles-lunarg
e3d07c49cb Update to latest Vulkan-Headers 2024-10-15 08:40:28 -06:00
charles-lunarg
f85a1f1e28 Update to latest Vulkan-Headers 2024-10-01 08:54:14 -06:00
Chris Dalton
30a13b23f6 Fix enable_extension_features_if_present on Vulkan 1.0
This method should call vkGetPhysicalDeviceFeatures2KHR on Vulkan 1.0.
2024-08-27 12:33:34 -06:00
charles-lunarg
5e7be28b43 Update to latest Vulkan-Headers 2024-08-27 08:32:34 -06:00
charles-lunarg
5ab30256e8 Update to latest Vulkan-Headers 2024-08-19 19:38:17 -06:00
Charles Giessen
1d77e652fa Make PhysicalDeviceSelector::set_require_featurs_1_X const
Make the API take the struct by const reference by creating a local
variable that copies the struct, allowing the sType to be set correctly.

The need to set the sType is due to a deficiency in the first version
of these functions, which allows users to not set the sType. Making
users set the sType is difficult because it breaks user code without
warning upon updating the version of vk-bootstrap used.
2024-08-04 14:41:05 -05:00
charles-lunarg
f89af55363 Update to latest Vulkan-Headers 2024-07-22 19:53:17 -05:00
Charles Giessen
42cef2cd14 static_cast the sType to allow Vulkan-Hpp types to work
The add_required_extensions_features function is templated, allowing both
vulkan.h and vulkan-hpp types to be passed in. Due to recent changes in
the generic features struct code, this stopped working. By casting the
sType explicitely using static_cast, it restores usage of vulkan-hpp types.
2024-07-01 09:54:16 -05:00
charles-lunarg
64fa0ebf56 Update to latest Vulkan-Headers 2024-06-13 10:40:49 -05:00
Charles Giessen
71a29a4b72 Make are_extension_features_present handle mismatched lists
The original implementation only worked if the requested features
had the same length. It'll now handle that properly.
2024-06-13 10:25:28 -05:00
n0F4x
fa75546109 Remove unnecessary feature checks 2024-06-13 10:25:28 -05:00
n0F4x
f238a7355f Fix typos in function documentation 2024-06-13 10:25:28 -05:00
n0F4x
92dc597184 Add are_extension_features_present to PhysicalDevice 2024-06-13 10:25:28 -05:00
Charles Giessen
91421d34b0 Set the sType for users to fix regression
Features 11, 12, and 13 structs used to set the sType manually for the user.
That was turned into an assert which inadvertently broke users code. This
is being reverted.
2024-06-13 09:21:58 -05:00
Imad Laggoune
fbad8786a4 [Change] Pass by Pointer to Pass by Reference
-Update all arguments in supports_features to be passed by reference rather then pointers.
-Make necessary changes for all calls to supports_features.
2024-05-29 11:48:22 +01:00
Imad Laggoune
cf2830cd32 Work Around for SEGFAULT in supports_features
-Turn every argument in support_features into const pointers.

-Change support_fueatures calls to match the new arguments.

-Add checks for nullptr.
2024-05-29 11:48:22 +01:00
Charles Giessen
8320b691f7 Rename parameter in enable_extension_features_if_present
Prevents shadowing warnings from annoying users.
2024-05-29 10:05:10 +01: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
a78a7f38da Assert that set_required_features sTypes are set
This allows the set_required_features_11/12/13 to take a reference instead
of a value. Applications should set the sType, vk-bootstrap shouldn't be
doing that for apps.
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
c7e50426ba Add alternate for deprecated desired extension functions 2024-02-11 11:18:56 -06:00
Mxr
eab517912c Further fix 2024-02-05 21:16:15 -08:00
Mxr
df5d11fc25 Fix: dangling reference in the range-based for loop 2024-02-05 21:16:15 -08:00
sean
6119bfcb9a Fix: Move objects/vectors where applicable 2024-01-30 10:06:25 -07:00
charles-lunarg
dd6c02e8ab Update to latest Vulkan-Headers 2024-01-30 08:33:40 -07:00
Diamond-D0gs
0af4cb5055 implemented enable_extensions_if_present and tests 2024-01-18 15:15:00 -07:00
Charles Giessen
51cbe62371 Add const case to parameter parsing in autogen
This was missing, causing errors in user code due to not preserving const
2023-12-29 11:26:50 -06:00
Charles Giessen
8e23c8afda Manually guard vkCmdSetExclusiveScissorEnableNV
vkCmdSetExclusiveScissorEnableNV was added to an existing extension
in 1.3.241. Guard it against users with older headers.
2023-12-28 16:18:00 -06:00
Charles Giessen
25dc27c31c Make destroy_* functions pass by reference
The destroy_instance and destroy_device functions should be passed by
const reference to make it consistent with other destroy functions.
2023-12-28 16:01:44 -06:00
charles-lunarg
605c3f1712 Update to latest Vulkan-Headers 2023-12-28 15:56:47 -06:00
Charles Giessen
3ad0388f1b Workaround VK_EXT_discard_rectangles adding new functions
Generalize the mechanism to not enable function pointers based on the current header
version, due to VK_EXT_discard_rectangles adding functions not present in the original
extension.
2023-12-14 13:05:31 -07:00
Charles Giessen
c16df41166 Fix aliased types not being generated
Types that are promoted get turned into aliases, but the dispatch table was missing
these types. This was due to a simple mistake of mixing up the alias with the type
being aliased.
2023-12-12 20:15:31 -07:00
charles-lunarg
ee817ba3c8 Update to latest Vulkan-Headers 2023-12-11 17:56:49 -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-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 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
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