diff --git a/src/VkBootstrap.cpp b/src/VkBootstrap.cpp index ca72957..929ef96 100644 --- a/src/VkBootstrap.cpp +++ b/src/VkBootstrap.cpp @@ -1341,20 +1341,20 @@ PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features(VkPhysical } #if defined(VKB_VK_API_VERSION_1_2) // Just calls add_required_features -PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_11(VkPhysicalDeviceVulkan11Features features_11) { - features_11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES; +PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_11(VkPhysicalDeviceVulkan11Features const& features_11) { + assert(features_11.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES); add_required_extension_features(features_11); return *this; } -PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_12(VkPhysicalDeviceVulkan12Features features_12) { - features_12.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES; +PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_12(VkPhysicalDeviceVulkan12Features const& features_12) { + assert(features_12.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES); add_required_extension_features(features_12); return *this; } #endif #if defined(VKB_VK_API_VERSION_1_3) -PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_13(VkPhysicalDeviceVulkan13Features features_13) { - features_13.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES; +PhysicalDeviceSelector& PhysicalDeviceSelector::set_required_features_13(VkPhysicalDeviceVulkan13Features const& features_13) { + assert(features_13.sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES); add_required_extension_features(features_13); return *this; } diff --git a/src/VkBootstrap.h b/src/VkBootstrap.h index 80a07ef..0e53fcc 100644 --- a/src/VkBootstrap.h +++ b/src/VkBootstrap.h @@ -629,15 +629,15 @@ class PhysicalDeviceSelector { #if defined(VKB_VK_API_VERSION_1_2) // 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 - PhysicalDeviceSelector& set_required_features_11(VkPhysicalDeviceVulkan11Features features_11); + PhysicalDeviceSelector& set_required_features_11(VkPhysicalDeviceVulkan11Features const& features_11); // Require a physical device which supports the features in VkPhysicalDeviceVulkan12Features. // Must have vulkan version 1.2 - PhysicalDeviceSelector& set_required_features_12(VkPhysicalDeviceVulkan12Features features_12); + PhysicalDeviceSelector& set_required_features_12(VkPhysicalDeviceVulkan12Features const& features_12); #endif #if defined(VKB_VK_API_VERSION_1_3) // Require a physical device which supports the features in VkPhysicalDeviceVulkan13Features. // Must have vulkan version 1.3 - PhysicalDeviceSelector& set_required_features_13(VkPhysicalDeviceVulkan13Features features_13); + PhysicalDeviceSelector& set_required_features_13(VkPhysicalDeviceVulkan13Features const& features_13); #endif // Used when surface creation happens after physical device selection.