}
}
+ VkBool32 maintenance5_feature_enabled = false;
+ // Look for the VkPhysicalDeviceMaintenance5FeaturesKHR struct to see if the feature was enabled
+ {
+ const void *pNext = localCreateInfo.pNext;
+ while (pNext != NULL) {
+ switch (*(VkStructureType *)pNext) {
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR: {
+ const VkPhysicalDeviceMaintenance5FeaturesKHR *maintenance_features = pNext;
+ if (maintenance_features->maintenance5 == VK_TRUE) {
+ maintenance5_feature_enabled = true;
+ }
+ pNext = maintenance_features->pNext;
+ break;
+ }
+
+ default: {
+ const VkBaseInStructure *header = pNext;
+ pNext = header->pNext;
+ break;
+ }
+ }
+ }
+ }
+
// Every extension that has a loader-defined terminator needs to be marked as enabled or disabled so that we know whether or
// not to return that terminator when vkGetDeviceProcAddr is called
for (uint32_t i = 0; i < localCreateInfo.enabledExtensionCount; ++i) {
dev->extensions.ext_debug_marker_enabled = true;
} else if (!strcmp(localCreateInfo.ppEnabledExtensionNames[i], "VK_EXT_full_screen_exclusive")) {
dev->extensions.ext_full_screen_exclusive_enabled = true;
- } else if (!strcmp(localCreateInfo.ppEnabledExtensionNames[i], VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) {
+ } else if (!strcmp(localCreateInfo.ppEnabledExtensionNames[i], VK_KHR_MAINTENANCE_5_EXTENSION_NAME) &&
+ maintenance5_feature_enabled) {
dev->should_ignore_device_commands_from_newer_version = true;
}
}
for (const auto& f : functions) {
driver.physical_devices.back().add_device_function(VulkanFunction{f, [] {}});
}
- {
+ { // doesn't enable the feature or extension
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 0, 0);
inst.CheckCreate();
ASSERT_NE(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
}
}
- {
+ { // doesn't enable the feature
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.set_api_version(1, 0, 0);
+ inst.CheckCreate();
+
+ DeviceWrapper dev{inst};
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
+ dev.CheckCreate(inst.GetPhysDev());
+ for (const auto& f : functions) {
+ ASSERT_NE(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
+ }
+ }
+ { // enables the feature and extension
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 0, 0);
inst.CheckCreate();
+ VkPhysicalDeviceMaintenance5FeaturesKHR features{};
+ features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR;
+ features.maintenance5 = VK_TRUE;
+
DeviceWrapper dev{inst};
dev.create_info.add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
+ dev.create_info.dev.pNext = &features;
dev.CheckCreate(inst.GetPhysDev());
for (const auto& f : functions) {
ASSERT_EQ(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
for (const auto& f : functions) {
driver.physical_devices.back().add_device_function(VulkanFunction{f, [] {}});
}
- {
+ { // doesn't enable the feature or extension
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 1, 0);
inst.CheckCreate();
ASSERT_NE(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
}
}
- {
+ { // doesn't enable the feature
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.set_api_version(1, 1, 0);
+ inst.CheckCreate();
+
+ DeviceWrapper dev{inst};
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
+ dev.CheckCreate(inst.GetPhysDev());
+
+ for (const auto& f : functions) {
+ ASSERT_NE(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
+ }
+ }
+ { // enables the feature and extension
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 1, 0);
inst.CheckCreate();
+ VkPhysicalDeviceMaintenance5FeaturesKHR features{};
+ features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR;
+ features.maintenance5 = VK_TRUE;
+
DeviceWrapper dev{inst};
dev.create_info.add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
+ dev.create_info.dev.pNext = &features;
dev.CheckCreate(inst.GetPhysDev());
for (const auto& f : functions) {
for (const auto& f : functions) {
driver.physical_devices.back().add_device_function(VulkanFunction{f, [] {}});
}
- {
+ { // doesn't enable the feature or extension
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 2, 0);
inst.CheckCreate();
ASSERT_NE(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
}
}
- {
+ { // doesn't enable the feature
+ InstWrapper inst{env.vulkan_functions};
+ inst.create_info.set_api_version(1, 2, 0);
+ inst.CheckCreate();
+
+ DeviceWrapper dev{inst};
+ dev.create_info.add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
+ dev.CheckCreate(inst.GetPhysDev());
+
+ for (const auto& f : functions) {
+ ASSERT_NE(nullptr, dev->vkGetDeviceProcAddr(dev.dev, f));
+ }
+ }
+ { // enables the feature and extension
InstWrapper inst{env.vulkan_functions};
inst.create_info.set_api_version(1, 2, 0);
inst.CheckCreate();
+ VkPhysicalDeviceMaintenance5FeaturesKHR features{};
+ features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR;
+ features.maintenance5 = VK_TRUE;
+
DeviceWrapper dev{inst};
dev.create_info.add_extension(VK_KHR_MAINTENANCE_5_EXTENSION_NAME);
+ dev.create_info.dev.pNext = &features;
dev.CheckCreate(inst.GetPhysDev());
for (const auto& f : functions) {