Revert "Revert "Fixed Features11/12 break. Tests now pass.""

This reverts commit 299b36a3a4.
This commit is contained in:
Charles Giessen 2021-04-18 14:14:17 -06:00
parent 8a3c1ac6ed
commit 5c85f3a796
3 changed files with 9 additions and 4 deletions

View File

@ -1259,12 +1259,14 @@ PhysicalDeviceSelector& PhysicalDeviceSelector::set_desired_version(uint32_t maj
#if defined(VK_API_VERSION_1_2) #if defined(VK_API_VERSION_1_2)
// Just calls add_required_features // Just calls add_required_features
PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_11( PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_11(
VkPhysicalDeviceVulkan11Features const& features_11) { VkPhysicalDeviceVulkan11Features& features_11) {
features_11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
add_required_extension_features(features_11); add_required_extension_features(features_11);
return *this; return *this;
} }
PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_12( PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_12(
VkPhysicalDeviceVulkan12Features const& features_12) { VkPhysicalDeviceVulkan12Features& features_12) {
features_12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
add_required_extension_features(features_12); add_required_extension_features(features_12);
return *this; return *this;
} }

View File

@ -549,10 +549,10 @@ class PhysicalDeviceSelector {
#if defined(VK_API_VERSION_1_2) #if defined(VK_API_VERSION_1_2)
// Require a physical device which supports the features in VkPhysicalDeviceVulkan11Features. // Require a physical device which supports the features in VkPhysicalDeviceVulkan11Features.
// Must have vulkan version 1.2 - This is due to the VkPhysicalDeviceVulkan11Features struct being added in 1.2, not 1.1 // Must have vulkan version 1.2 - This is due to the VkPhysicalDeviceVulkan11Features struct being added in 1.2, not 1.1
PhysicalDeviceSelector& set_required_features_11(VkPhysicalDeviceVulkan11Features const& features_11); PhysicalDeviceSelector& set_required_features_11(VkPhysicalDeviceVulkan11Features& features_11);
// Require a physical device which supports the features in VkPhysicalDeviceVulkan12Features. // Require a physical device which supports the features in VkPhysicalDeviceVulkan12Features.
// Must have vulkan version 1.2 // Must have vulkan version 1.2
PhysicalDeviceSelector& set_required_features_12(VkPhysicalDeviceVulkan12Features const& features_12); PhysicalDeviceSelector& set_required_features_12(VkPhysicalDeviceVulkan12Features& features_12);
#endif #endif
// Used when surface creation happens after physical device selection. // Used when surface creation happens after physical device selection.

View File

@ -454,8 +454,10 @@ TEST_CASE("Querying Vulkan 1.1 and 1.2 features", "[VkBootstrap.version]") {
// Requires a device that supports multiview and bufferDeviceAddress // Requires a device that supports multiview and bufferDeviceAddress
{ {
VkPhysicalDeviceVulkan11Features features_11{}; VkPhysicalDeviceVulkan11Features features_11{};
features_11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
features_11.multiview = true; features_11.multiview = true;
VkPhysicalDeviceVulkan12Features features_12{}; VkPhysicalDeviceVulkan12Features features_12{};
features_11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES;
features_12.bufferDeviceAddress = true; features_12.bufferDeviceAddress = true;
vkb::PhysicalDeviceSelector selector(instance_ret.value()); vkb::PhysicalDeviceSelector selector(instance_ret.value());
@ -472,6 +474,7 @@ TEST_CASE("Querying Vulkan 1.1 and 1.2 features", "[VkBootstrap.version]") {
// protectedMemory should NOT be supported // protectedMemory should NOT be supported
{ {
VkPhysicalDeviceVulkan11Features features_11{}; VkPhysicalDeviceVulkan11Features features_11{};
features_11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
features_11.protectedMemory = true; features_11.protectedMemory = true;
vkb::PhysicalDeviceSelector selector(instance_ret.value()); vkb::PhysicalDeviceSelector selector(instance_ret.value());