Make the API take the struct by const reference by creating a local
variable that copies the struct, allowing the sType to be set correctly.
The need to set the sType is due to a deficiency in the first version
of these functions, which allows users to not set the sType. Making
users set the sType is difficult because it breaks user code without
warning upon updating the version of vk-bootstrap used.
Since the API can accept vulkan-hpp types in a few places, it is good to have
tests for those places. While the current test suite isn't exhaustive, it is
enough to get the ball rolling.
This PR also refactors some of the 'setup' logic for the tests into a separate
file so that the hpp tests can make use of them.
The add_required_extensions_features function is templated, allowing both
vulkan.h and vulkan-hpp types to be passed in. Due to recent changes in
the generic features struct code, this stopped working. By casting the
sType explicitely using static_cast, it restores usage of vulkan-hpp types.
Features 11, 12, and 13 structs used to set the sType manually for the user.
That was turned into an assert which inadvertently broke users code. This
is being reverted.
Allows users to enable features if they are present, getting back a bool
telling them whether the feature is supported and will be enabled on the
device.
Also:
* Removes redundant VkPhysicalDeviceFeatures2 struct in vkb::PhysicalDevice.
* Adds test copying of details when creating a VkDevice so that test can check
what features were actually enabled on the device.
* Creates GenericFeatureChain struct for managing pNext chains.
* Allow multiple calls to set_require_features by combining the fields
This allows the set_required_features_11/12/13 to take a reference instead
of a value. Applications should set the sType, vk-bootstrap shouldn't be
doing that for apps.
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.