Commit Graph

25 Commits

Author SHA1 Message Date
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
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
spnda
f5f9b54f38 Add user-defined conversion operators 2021-09-10 14:29:40 -06:00
Andreas Pokorny
81f542e119 also fix typo in example and tests 2021-09-06 15:10:59 -06:00
Charles Giessen
b3fdd554b4 Add vkb::destroy_surface helper function 2021-06-06 13:25:08 -07:00
Charles Giessen
23dcdd59bf example: Add config file to locate shaders
The example triangle now will have a absolute filepath to the shaders.
This allows running the exe from directories other than the location of the shaders in the filesystem.
Alternative solutions would be to copy/paste the shader binary into the source code.
2021-04-16 10:30:04 -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
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
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
a806c367f3 Added window titles for tests 2020-05-19 11:10:50 -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
1daf83f541 Made clang-cl use the right warning flags 2020-05-03 21:54:40 -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
1014c836cb Refactor of queue selection and getting 2020-03-07 17:02:01 -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
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
2b711f30d5 Finished basic rewrite of queue handling logic
Premise is to let the easy creation of a compute or transfer queue.
If the user supplies a custom list they want to use, defer to that.
Else, enable the basic requirements and be on your merry way.
2020-02-10 18:01:58 -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