Commit Graph

40 Commits

Author SHA1 Message Date
Charles Giessen
e0e6123d20 Use depends attr in xml to generate correct macro defines
The vulkan spec updated to include depends="" attributes in the requires blocks of extensions.
The autogen needed to be updated to use that as that is the correct mechanism to ascertain which
functions require more than one extension to be present. This also required refactoring the logic
to respect that.
2024-11-17 16:26:34 -07: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 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
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
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 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
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
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
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
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
David Dubois
1fea63645a Properly handle forward-declared structs 2022-08-28 12:13:08 -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 Giessen
b87fcf2da2 Add ci action to automate running autogen 2022-02-15 22:06:55 -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
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
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
6eefc9c7e2 Added dependency prompt/exception handling. 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
45419be295 Removed old unused vars 2021-06-06 12:49:23 -07:00
Cody Goodson
63d252e828 Rework complete. 2021-06-06 12:49:23 -07:00
Cody Goodson
ae402c6a19 Function loading is working again and now handles collections of requirements. Only header gen is left. 2021-06-06 12:49:23 -07:00
Cody Goodson
88358fb9cf In progress rework 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
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
Cody Goodson
b06763b187 In progress dispatch gen 2021-06-06 12:49:23 -07:00