Commit Graph

263 Commits

Author SHA1 Message Date
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
charles-lunarg
6be9ef9f46 Update to latest Vulkan-Headers 2023-10-09 18:46:37 -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
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
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
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