Commit Graph

181 Commits

Author SHA1 Message Date
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
Charles Giessen
c607a65755 Remove memset, fix mismatched size comparison 2021-04-18 14:42:35 -06:00
Charles Giessen
7271cac30c Revert "Revert "Removed duplicate include.""
This reverts commit 0b2faf5659.
2021-04-18 14:42:35 -06:00
Charles Giessen
193c20491a Revert "Revert "Cleanup and warning for user provided VkPhysicalDeviceFeatures2.""
This reverts commit 38d150101b.
2021-04-18 14:42:35 -06:00
Charles Giessen
90875cfaf5 Revert "Revert "Cleanup and asserts for VkPhysicalDeviceFeatures2.""
This reverts commit db55cb8f27.
2021-04-18 14:42:35 -06:00
Charles Giessen
a0d1ce5b39 Revert "Revert "Simplified structures and plugged into existing logic.""
This reverts commit 2a352b5a25.
2021-04-18 14:42:35 -06:00
Charles Giessen
f4eb8fdffc Revert "Revert "Collapsed ExtensionFeatures and StructureContainer together into FeaturesContainer. After the purging of the function pointers all ExtensionFeatures was doing was just wrapping StructureContainers functions.""
This reverts commit 64aeed5855.
2021-04-18 14:42:35 -06:00
Charles Giessen
9c4317e324 Revert "Revert "Removes need for function pointers.""
This reverts commit e671170007.
2021-04-18 14:42:35 -06:00
Charles Giessen
63f06898f9 Revert "Revert "Assert for null sTypes.""
This reverts commit 7126555c3b.
2021-04-18 14:42:35 -06:00
Charles Giessen
3c38977084 Revert "Revert "Pass by value rather than ref.""
This reverts commit 441938d731.
2021-04-18 14:42:35 -06:00
Charles Giessen
5c85f3a796 Revert "Revert "Fixed Features11/12 break. Tests now pass.""
This reverts commit 299b36a3a4.
2021-04-18 14:42:35 -06:00
Charles Giessen
8a3c1ac6ed Revert "Revert "- Restored removed functions - Restored pNext chain to device (appends to the end of the ExtentionFeatures chain) - Style changes - Migrated ExtensionFeatures into detail""
This reverts commit 4bfc21f8be.
2021-04-18 14:42:35 -06:00
Charles Giessen
e8100dd16c Revert "Revert "Fix breaking bug with features not being populated from VkGetPhysicalDeviceFeatures2""
This reverts commit 77be102a13.
2021-04-18 14:42:35 -06:00
Charles Giessen
98a4ae7ea8 Revert "Revert "Added generic feature polling/matching/enabling.""
This reverts commit 523e76144d.
2021-04-18 14:42:35 -06:00
Charles Giessen
523e76144d Revert "Added generic feature polling/matching/enabling."
This reverts commit 0a397a33d5.
2021-04-18 14:09:56 -06:00
Charles Giessen
77be102a13 Revert "Fix breaking bug with features not being populated from VkGetPhysicalDeviceFeatures2"
This reverts commit 21e400cfcc.
2021-04-18 14:09:56 -06:00
Charles Giessen
4bfc21f8be Revert "- Restored removed functions - Restored pNext chain to device (appends to the end of the ExtentionFeatures chain) - Style changes - Migrated ExtensionFeatures into detail"
This reverts commit 0359ceb3fb.
2021-04-18 14:09:56 -06:00
Charles Giessen
299b36a3a4 Revert "Fixed Features11/12 break. Tests now pass."
This reverts commit 632a42f5cd.
2021-04-18 14:09:56 -06:00
Charles Giessen
441938d731 Revert "Pass by value rather than ref."
This reverts commit 3dc81e44df.
2021-04-18 14:09:56 -06:00
Charles Giessen
7126555c3b Revert "Assert for null sTypes."
This reverts commit 73e2b82dce.
2021-04-18 14:09:56 -06:00
Charles Giessen
e671170007 Revert "Removes need for function pointers."
This reverts commit 075be4900b.
2021-04-18 14:09:56 -06:00
Charles Giessen
64aeed5855 Revert "Collapsed ExtensionFeatures and StructureContainer together into FeaturesContainer. After the purging of the function pointers all ExtensionFeatures was doing was just wrapping StructureContainers functions."
This reverts commit 2f69fa52cb.
2021-04-18 14:09:56 -06:00
Charles Giessen
2a352b5a25 Revert "Simplified structures and plugged into existing logic."
This reverts commit 6ee81abdd3.
2021-04-18 14:09:56 -06:00
Charles Giessen
db55cb8f27 Revert "Cleanup and asserts for VkPhysicalDeviceFeatures2."
This reverts commit 5ac038b778.
2021-04-18 14:09:56 -06:00
Charles Giessen
38d150101b Revert "Cleanup and warning for user provided VkPhysicalDeviceFeatures2."
This reverts commit 91b3949339.
2021-04-18 14:09:56 -06:00
Charles Giessen
0b2faf5659 Revert "Removed duplicate include."
This reverts commit 6a9e0e2ee8.
2021-04-18 14:09:56 -06:00
Cody Goodson
6a9e0e2ee8 Removed duplicate include. 2021-04-18 14:04:27 -06:00
Cody Goodson
91b3949339 Cleanup and warning for user provided VkPhysicalDeviceFeatures2. 2021-04-18 14:04:27 -06:00
Cody Goodson
5ac038b778 Cleanup and asserts for VkPhysicalDeviceFeatures2. 2021-04-18 14:04:27 -06:00
Cody Goodson
6ee81abdd3 Simplified structures and plugged into existing logic. 2021-04-18 14:04:27 -06:00
Cody Goodson
2f69fa52cb Collapsed ExtensionFeatures and StructureContainer together into FeaturesContainer. After the purging of the function pointers all ExtensionFeatures was doing was just wrapping StructureContainers functions. 2021-04-18 14:04:27 -06:00
Cody Goodson
075be4900b Removes need for function pointers. 2021-04-18 14:04:27 -06:00
vibi-manx
73e2b82dce Assert for null sTypes. 2021-04-18 14:04:27 -06:00
vibi-manx
3dc81e44df Pass by value rather than ref. 2021-04-18 14:04:27 -06:00
vibi-manx
632a42f5cd Fixed Features11/12 break. Tests now pass. 2021-04-18 14:04:27 -06:00
vibi-manx
0359ceb3fb - Restored removed functions
- Restored pNext chain to device (appends to the end of the ExtentionFeatures chain)
- Style changes
- Migrated ExtensionFeatures into detail
2021-04-18 14:04:27 -06:00
dangerkangaroo
21e400cfcc Fix breaking bug with features not being populated from VkGetPhysicalDeviceFeatures2 2021-04-18 14:04:27 -06:00
dangerkangaroo
0a397a33d5 Added generic feature polling/matching/enabling. 2021-04-18 14:04:27 -06:00
dangerfen
ef02739a10 Added macro guard. 2021-04-07 19:26:59 -06:00
dangerfen
1b6e09a04a Fixes bug with 1.1/1.2 features not being appended to the pNext chain properly. 2021-04-07 19:26:59 -06:00
Mehmet Oguz Derin
903fdfe87b Compare against feature flags 2021-04-06 15:04:24 -06:00
Mehmet Oguz Derin
617123254a Compare against feature flags 2021-04-06 15:04:24 -06:00
Mehmet Oguz Derin
8d4ac0db50 Check usage flags when iterating desired formats 2021-04-06 15:04:24 -06:00
Charles Giessen
151c76d1cc Add selection by and enableing 1.1 and 1.2 features.
Users can now ask for physical devices which support a specific 1.1 and 1.2
feature. VkBootstrap will then add the selected features to the enable list
in device creation.
2021-03-29 13:23:27 -06:00
Charles Giessen
cf8df11a0a Change clang-format to not add spaces before parens 2021-02-18 13:26:43 -07:00
Charles Giessen
3ebe53bdfe Add full_error() function to Result for easier printing of errors
Comment the various error functions in Result
2021-02-18 13:26:43 -07:00
Charles Giessen
4120362762 Use uint32_t in Queues everywhere, add QUEUE_INDEX_MAX_VALUE as sentinel
This commit removes the many casts from int to uint and back, as -1 was used
as a sentinel value. Because thats confusing and leads to many casts
everywhere it was decided to add a sentinel value and compare everything
to that to determine if a queue index is valid or not.
2021-02-18 13:26:43 -07:00
Charles Giessen
daf244d180 Make SwapchainBuilder constructor take allocation callbacks from device 2021-02-18 13:26:43 -07:00
Charles Giessen
bfc0f06de0 Run clang format on src/VkBootstrap.h 2021-02-18 13:26:43 -07:00
Charles Giessen
bcc8e6f664 Add defaults in comments for SwapchainBuilder 2021-02-18 13:26:43 -07:00
Charles Giessen
c71a5b5fd8 Guard NOMINMAX
mingw64 defines it by default, this prevents multiple definition warnings/errors
2021-02-18 13:26:43 -07:00
Charles Giessen
c02642843c Fix crash due to vector initialization using wrong constructor
Because VkImageView is a uint64_t, not a strong type, the constructor
thinks the .size() is a value to initialize with, not a size.
2020-12-17 01:43:39 -07:00
Charles Giessen
af5409fcea Fix errors which caused win32 builds to fail
The debug_callback_messenger didn't use the VK_API macros and there
were a few places that compared VkHandles to nullptr which weren't liked.
2020-12-17 00:46:08 -07:00
Charles Giessen
325cdff399 Correct macOS surface extension.
The extension name is VK_EXT_metal_surface, not KHR
2020-11-20 16:33:22 -07:00
Charles Giessen
988c0ea4e4 Make swapchain builder find queues if none were provided 2020-10-26 13:17:52 -06:00
Charles Giessen
d314069e1a Fix linux surface extension bug, make destroy_debug_utils_messenger public
Making the destroy_messenger public allows code to store the handle directly and
delete it themselves instead of having to hold onto a vkb::Instance, which requires
including the header.
2020-10-21 15:32:10 -06:00
Charles Giessen
6e50441f41 Re-added swapchain constructors from individual handles.
Allows people to use Swapchain Builder withtout holding onto the vkb::Device
handle. Also made patch levels optional since they generally don't matter.
2020-10-21 13:25:48 -06:00
Charles Giessen
6657593fa3 Fixed static initialization of VulkanFunctions 2020-09-26 12:15:40 -06:00
Charles Giessen
812ce2cf0a Dynamically load vulkan instead of statically link.
Make vk-bootstrap capable of loading the vulkan runtime and not need to
link against the library. This improves the usability of vk-bootstrap since
now you don't need the vulkan library on your system to build.

This commit also changes how SystemInfo works so as to allow the dynamic
vulkan loading.
2020-08-10 23:38:26 -06:00
Charles Giessen
511cac8db4 Fix license, add it to source, fix readme.
Delete .gitmodules, update readme to mention that enabling testing
automatically gets the dependencies, no more git submodules.
Add license to top of source files.
2020-06-10 13:39:14 -06:00
Charles Giessen
bbe3971a04 Document proper swapchain recreation practice
Make the example not leak the old swapchain handle upon recreation.
vkb::destroy_swapchain doesn't null out the old handle.
2020-06-08 17:03:36 -06:00
Charles Giessen
d169f3e32d Updated docs to include device and swapchain deletion.
Fix example triangle to properly exit if swapchain recreation fails.
2020-06-08 15:40:33 -06:00
Charles Giessen
8a053cadc3 Polished SwapchainBuilder. Redid swapchain recreation.
To recreate a swapchain now requires making a new SwapchainBuilder or
keeping the old one around. Removed the recreate function since its
purpose was unclear. Introduced set_old_swapchain to allow recyling the
old swapchain. Updated documentation and getting started guide.
2020-06-08 14:28:32 -06:00
Charles Giessen
e2c65e7ec1 Add some SwapchainBuilder options.
Now able to set the image usage flags, the array layer count, and whether
to clip the swapchain or not.
2020-05-26 13:33:40 -06:00
Charles Giessen
698be4e09b Fixed linux wsi extensions being added erroneously
Previously, on linux all three windowing extensions would be added
(xcb, xlib, wayland) even if they weren't available.
Now, InstanceBuilder first makes sure they are present before
adding them.

Also added a new error code to represent the lack of wsi extensions
2020-05-19 10:44:40 -06:00
Charles Giessen
3bbc4831f5 Updated docs for error_code usage
Updated the documentation for using the new <error_code> based errors.
Also fixed an issue where SystemInfo wouldn't check if layers had a
debug_utils extension.
2020-05-18 23:50:24 -06:00
Lesley Lai
df53490ede Error handling with std::error_code 2020-05-17 09:19:12 -06:00
Charles Giessen
c79482c0b1 Updated the default image formats for the swapchain
Used to use UNORM, now uses SRGB.
2020-05-09 17:22:45 -06:00
Charles Giessen
5e5b446d41 Renamed swapchain error for missing surface.
Now its 'surface_handle_not_provided' instead of not_present.
More clear because you have to manually provide a surface handle, its
not implicitely created for you.
2020-04-21 12:14:25 -06:00
Charles Giessen
d99c378eea Added new constructor to SwapchainBuilder
It is now possible to pass in a vkb::Device and a VkSurfaceKHR handle
into the swapchain builder, and it will correctly get the queue indexes
necessary to create a swapchain. This solved the 'delayed surface
initialization' problem
2020-04-19 17:59:32 -06:00
Charles Giessen
ace1ccf854 Explicit swapchain constructor no longer uses queue indexes
The second constructor for vkb::Swapchain now queries for the index of the
graphics and present queue by itself. This removes the need to users to
manually specify it and limits the strict dependency between swapchain
and the rest of the vkb structs (Instance & Device mainly)
2020-04-19 02:03:15 -06:00
Charles Giessen
959979b07a Fixed missing setup for deferred surface init
It needed to add the surface extension and not check for present
support.
2020-04-19 00:52:31 -06:00
Charles Giessen
1f462b42f3 Added many tests and fixed up api as a consequence
Added device::get_queue_families() to facilitate custom queue setups

get_swapchain_images() renamed to get_image(), made member function to
swapchain.
get_swapchain_image_views() renamed to get_image_views(), also moved to
member function of swapchain

fixed bug with headless instance not being correct

Stopped Catch2 from polluting the buildable targets
2020-04-18 21:24:59 -06:00
Lesley Lai
4483a5ee90 Migrate to Catch2 & CMake file structural change 2020-03-26 10:40:47 -06:00
Charles Giessen
a727a05635 Fixed EnumerateInstaceVersion using the wrong variable 2020-03-22 13:47:05 -06:00
Charles Giessen
c467c6c228 Fixed InstanceBuilder::request_validation_layers checking for extensions 2020-03-22 13:25:35 -06:00
Charles Giessen
b330527d65 Fixed default_debug_callback warning over unused formal paramter 2020-03-14 19:57:40 -06:00
Charles Giessen
505f9d91f9 Fixed msvc warnings 2020-03-11 21:26:41 -06:00
Charles Giessen
dde974d912 Fixed bugs in check_device_extension_support 2020-03-11 21:19:31 -06:00
Charles Giessen
bfcc4c6bfa Touched up many components due to integration experience 2020-03-09 22:15:08 -06:00
Charles Giessen
4c91df1c12 Added a desired_api_version to InstanceBuilder and cleaned up the triangle example error handling.
Fixed several bugs in the PhysicalDeviceSelector code, causing erroneous failures.
2020-03-09 15:17:18 -06:00
Charles Giessen
1160b19a5c Rename set_api_version to required_api_version and make the PhysicalDeviceSelector use the provided value as the required minimum for devices 2020-03-08 00:59:58 -07:00
Charles Giessen
bb312e8c92 InstanceBuilder now validates the apiVersion passed in and returns and error if the version is unsupported 2020-03-08 00:14:36 -07:00
Charles Giessen
40488fc7cd Added defer_surface_initialization which allows skipping checking if a device and surface work together 2020-03-07 23:26:46 -07:00
Charles Giessen
3097f46074 Enabled warnings and fixes the warnings gcc/clang showed. Formatted CMakeLists.txt 2020-03-07 22:58:23 -07:00
Charles Giessen
10d9c2ee1b Added const to builder functions and many other functions 2020-03-07 22:21:27 -07:00
Charles Giessen
5ae586b559 Created vk function pointer loading helper function 2020-03-07 21:57:49 -07:00
Charles Giessen
f389114811 Documented that features & extensions are propagated to DeviceBuilder 2020-03-07 17:36:55 -07:00
Charles Giessen
f74ee5e9fc Ammended readme and moved around code for better readability 2020-03-07 17:19:58 -07:00
Charles Giessen
1014c836cb Refactor of queue selection and getting 2020-03-07 17:02:01 -07:00
Charles Giessen
83fd58348b Rename distinct queue functions and variables to seperate 2020-03-07 16:02:18 -07:00
Charles Giessen
6043129631 Renamed allow_fallback_gpu_type to allow_any_type and refactored implementation to be simpler 2020-03-07 15:48:52 -07:00