Commit Graph

408 Commits

Author SHA1 Message Date
Mxr
df5d11fc25 Fix: dangling reference in the range-based for loop 2024-02-05 21:16:15 -08:00
charles-lunarg
2321c238d4 Update to latest Vulkan-Headers 2024-02-05 21:12:03 -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-lunarg
382259e32b Update to latest Vulkan-Headers 2024-01-09 09:38:29 -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
ae05c97bdb Create Vulkan::Headers if CMake version is too low. 2023-12-14 11:24:51 -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
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
767bd1baf2 Fixup Clang on windows support
This commit fixes issues that prevented clang-cl & clang from being distinguished
on windows, resulting in improper command line arguments being used.

CMAKE_CXX_COMPILER_FRONTEND_VARIANT is the proper way to distinguish clang from
clang-cl, which have different command line options.
2023-12-06 14:07:18 -07:00
charles-lunarg
e2e2d69785 Update to latest Vulkan-Headers 2023-12-04 17:44:05 -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
34be5eb2c5 Update to GLFW 3.3.8 in example code 2023-12-02 19:49:54 -07:00
Charles Giessen
622e36a487 Small cleanup of tests 2023-12-02 11:32:03 -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 Giessen
e5dd024a51 Add version in tag description 2023-11-28 13:37:30 -07:00
Charles Giessen
03ac201309 Fix bugs in create_tag.yml
Forgot to checkout the repo and didn't have the correct path to a file.
2023-11-28 13:35:32 -07:00
Charles Giessen
a1471b414f Add workflow to tag header updates
Workflow is triggered manually in order to allow for me to review the PR first.
2023-11-28 14:31:14 -06: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-lunarg
d4295cf688 Update to latest Vulkan-Headers 2023-11-18 11:39: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
a1a0aba737 Update C++ minimum to 17 2023-10-30 11:43:57 -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
Charles Giessen
be0df09b3a Update CMake minimum to 3.15
The Vulkan-Headers has a minimum of 3.15, and there is no great reason
to stay on such an old CMake version.
2023-10-09 13:24:09 -06: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
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
5e351fcdf8
Update run_autogen.yml to use main branch
Forgot to update this when changing the repo default from master to main.
2023-10-02 19:19:59 -06:00
Charles Giessen
f6006041c6 Mark vk-bootstrap as static & cleanup CMake
Marks the main vk-bootstrap library as a static library.

Removes unnecessary code, adds a language & description to the project
field.
2023-09-24 18:55:32 -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