Commit Graph

48 Commits

Author SHA1 Message Date
Charles Giessen
4a30810a87 Added DelayedDeletionQueue and SwapchainManager to abstract presentation
The DelayedDeletionQueue is a general utility for queueing up things to delete at a future time.
This simplifies swapchain recreation by making the deletion of in-use objects to be done later when they are no longer in use.

The SwapchainManager handles all aspects of a swapchain:
 * Creation - Pass a SwapchainBuilder to specify how the swapchain should be created.
 * Recreation - Recreates the swapchain without introducing a pipeline stall through the use of an internal DelayedDeletionQueue.
 * Semaphores - Handles setting up the semaphores for acquiring a swapchain image, submitting work to draw to it, then presenting it.
 * Fences - Owns the fences associated with the command buffer submissions which write to the swapchain image.

Optionally, the SwapchainManager can also provide command buffers in which to record with for ease of use in simple situations.

There is a ImagelessFramebufferBuilder to simplify creating imageless framebuffers into a few lines of code. Nothing special,
but is a nice thing to have

Also in these changes
Fixed issue with image usage flags inheriting the wrong flags and causing validation message spam.
2021-06-29 23:57:25 -06:00
Charles Giessen
867376d01e Move debug callback into header and allow adding user pointer 2021-06-14 15:17:37 -07:00
Charles Giessen
e511dfdbf9 test: Add 1.0 test for feature config selection 2021-06-10 10:06:14 -07:00
Cody Goodson
f49032f804 Internal table change.
- Internal tables are now populated through internal vkGetDeviceProcAddr rather than through passed dispatch table
- Device now has its own internal table as well.
- Cleaned up get_proc_addr functions and removed internal functions that are now held in a types internal tables.
2021-06-08 14:03:47 -07:00
Cody Goodson
f5d3061043 Added optional dispatch table usage to swapchain. 2021-06-08 14:03:47 -07:00
Charles Giessen
b3fdd554b4 Add vkb::destroy_surface helper function 2021-06-06 13:25:08 -07: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
a61e221d59 Trimmed branching in script and modified usage in core lib. 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
Charles Giessen
bae94d9f47 example: Load vkDestroySurfaceKHR correctly.
vkDestroySurfaceKHR needs to be loaded with vkGetInstanceProcAddr, not vkGetDeviceProcAddr.
2021-05-21 14:04:28 -06:00
Charles Giessen
ab60522c9b Format internal queue selection functions 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
a0d1ce5b39 Revert "Revert "Simplified structures and plugged into existing logic.""
This reverts commit 2a352b5a25.
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
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
2a352b5a25 Revert "Simplified structures and plugged into existing logic."
This reverts commit 6ee81abdd3.
2021-04-18 14:09:56 -06:00
Cody Goodson
6ee81abdd3 Simplified structures and plugged into existing logic. 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
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
07ae8845a7 test: Use VK_NULL_HANDLE to enable 32 bit builds 2021-03-02 09:11:23 -07:00
Charles Giessen
0c29d98362 cmake: Don't require vulkan in order to build
find_package is used to try to find the Vulkan-Headers, and if they aren't
present, it downloads them with fetch content. This way users don't need
vulkan 'installed' on their system, specifically for windows users.

It also changes the tests to load all the necessary function pointers, that
 way we don't need to find the vulkan loader to build the tests.
2021-03-02 09:11:23 -07:00
Charles Giessen
947afe55c0 Add default gotten queues test for swapchain builder 2020-10-26 13:21:59 -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
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
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
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
a806c367f3 Added window titles for tests 2020-05-19 11:10:50 -06:00
Lesley Lai
df53490ede Error handling with std::error_code 2020-05-17 09:19:12 -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
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
a4ab8e099d Renamed many InstanceBuilder functions, added SystemInfo struct.
SystemInfo will be the way for users to know what is and isn't available on their system.
Currently, it only has booleans for if validation layers and debug messenger are available,
but more could be added in the future.
2020-03-07 01:46:25 -07:00
Charles Giessen
6f0184bdbe Made compute and transfer queues have distinct and dedicated options. This means you can choose between
whether you select a compute/transfer queue that can alias and one that cannot.
It is due to some hardware having dedicated compute or dedicated transfer but not both.

Also added some todo's for what to test.
2020-02-18 19:45:22 -07:00
Charles Giessen
37656d311a Added documentation to InstanBuilder and PhysicalDevice Selector
Updated readme's example code and included better build instructions
2020-02-18 19:17:08 -07:00
Charles Giessen
7de79b81b1 Implemented missing instance functions, deleted surface in tests. 2020-02-18 17:21:22 -07:00
Charles Giessen
b171ced11e Fixed pNext chain setup function and added validation flags/enables to run_tests 2020-02-17 14:09:40 -07:00
Charles Giessen
cf8411ae78 Replaced std::string with const char *
Now checks extensions being valid on the instance.
2020-02-11 17:51:03 -07:00
Charles Giessen
3e7e283e3f Revised error handling to be sensible and consistent.
While more error values need to be fleshed out (one for every possible vulkan error)
it has all of the major issues handled.
2020-02-10 11:29:09 -07:00
Charles Giessen
8734ed18e0 moved triangle.cpp to its own folder, updated readme & license 2020-02-03 20:34:46 -07:00
Charles Giessen
39a3c37465 Fixed up swapchain, added an example based on vulkan-tutorial
Now there is a concise example of the library in use all the way to presenting.

Needs to be rewritten to remove exceptions, but for first pass its good enough.
2020-02-03 16:23:47 -07:00
Charles Giessen
37bc741658 Moved all source code into 2 files
This will make it easier to include in other projects.

Revamped how pNext chains work to no longer cause crashes.
2020-01-31 15:23:22 -07:00
Charles Giessen
155677ec0f Added glfw as git submodule + Catch2
Made the physical device, device, and swapchain builders take the required
parameters as constructor arugments.

Made tests optional using a cmake bool
2020-01-30 01:47:41 -07:00
Charles Giessen
d9ca075c86 First commit of Vk-Bootstrap
Library contains barebones implementations for simplified
	Instance creation
	Physical Device selection
	Device creation
	Swapchain Creation/Recreation

Much of the repo is WIP, and there is little to no testing.
Also, while a single header file is desired for the future, currently
it is structured more like a normal project with .cpp files
2020-01-30 01:20:18 -07:00