What's the point of the warning about the deprecation of the extension(promoted)?

What am I supposed to do about this warning? Write another code to use a different version of Vulkan when the code based on version 1.0 + extensions works perfectly for my use case? Or could the extension be removed in the near future? Is using the extension instead of the supposedly equivalent core command (I read some excerpts from the Mesa driver for Intel and the core command was just an alias for the extension) wrong?

Edit: I changed the title to clarify that I’m talking about promoted extensions.

What warning exactly are you getting and where?

The standard contains a description of what it means for an extension to be deprecated. What you do with that information is up to you and your application’s needs.

1 Like

It’s a warning stating that the extension (VK_KHR_maintenance1) has been promoted to core in the current instance version (1.1). This occurs with several other promoted extensions like VK_KHR_get_memory_requirements2, VK_KHR_bind_memory2, and others. At the moment, I don’t have access to the computer to paste the message emitted by the validation layer.

Where is this warning coming from? Is it some kind of debug message, or is it just text in a header file?

I obtain it from the validation layer through the debug messenger, and I’ve also enabled the best practices feature.

Validation layer log(vulkan 1.1):

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_maintenance1, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_maintenance2, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_shader_draw_parameters, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_descriptor_update_template, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_storage_buffer_storage_class, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_relaxed_block_layout, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_get_memory_requirements2, but this extension has been promoted to VK_VERSION_1_1.

[2023-08-22T15:26:06Z TRACE vk::debug_utils_messenger] Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: handle = 0x56122b0982d0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_bind_memory2, but this extension has been promoted to VK_VERSION_1_1.

OK, so validation layers are reporting this warning. Did you ask for version 1.1 or above, or did you ask for version 1.0? That is, is your VkApplicationInfo::apiVersion 1.0 or is it 1.1+?

If it’s 1.0, then I would say that these warnings are a layer bug. You specifically asked for Vulkan 1.0, so it shouldn’t complain when you try to use extensions that were deprecated in higher versions.

But if you asked for 1.1, which has deprecated these extensions, then the warnings are valid. The version you ask for should be the minimum version you are coding against. If your minimum version is one that deprecates some extensions, you probably shouldn’t be using those extensions.

I’ve enabled API 1.1 and there are no issues with the validation layer or warnings. What I want to know is why shouldn’t I use the extension in situations where the Vulkan instance already supports the same functionality as the core? I mean, if what the Vulkan instance provides is an alias of the extension, what’s the problem if I try to enable the extension? The approach of writing new code to comply with these warnings doesn’t seem reasonable. Will I have to write new code every time I need to use a new core version of Vulkan?

Your problem seems to be a lack of understanding of what it means to specify an apiVersion. If you set this field to a version, you are declaring that your code is written against that specific version and cannot be used with any implementation that is not backwards-compatible with that version. This also means that, when you wrote the code, you did so knowing and expecting all of the capabilities outlined in that version of the specification.

Given that fact, it makes no sense to then use features that are deprecated in the version of the API that you are writing your code against.

Then ignore the warning. And face the consequences when you try to run your code on an implementation that doesn’t provide the deprecated functionality anymore but does provide the version you asked for.

I understand that apiVersion defines the minimum version of functionality that your code supports. However, please note that promoted versions do not guarantee compatibility with the extension from which they were derived (Extending Vulkan :: Vulkan Documentation Project Demo). What I mean is that the two functionalities can be different, and one way of ensuring compatibility is to continue using the extension. The warning seems too hasty for this scenario. If the extensions will be removed in the future that should also be described in the warning.

The word “deprecated” already means that. It means that such functionality is subject to future removal.

Maybe I’m worrying too much about something irrelevant. Thanks.