Skip to content

Handle extension-wide deprecatedby/supersededby attributes#1039

Open
MarijnS95 wants to merge 1 commit into
masterfrom
per-extension-deprecation
Open

Handle extension-wide deprecatedby/supersededby attributes#1039
MarijnS95 wants to merge 1 commit into
masterfrom
per-extension-deprecation

Conversation

@MarijnS95
Copy link
Copy Markdown
Collaborator

After deciding to back out of marking individual commands and types as #[deprecated] because superseding functionality is unlikely to be widely available yet, there are however niche or vendor-specific extensions that have been replaced by more common EXT/KHR extensions or even stabilized features. These would benefit from nudging the user towards the newer and/or cross-platform functionality which is more likely to be prevalent.

After deciding to back out of marking individual commands and types
as `#[deprecated]` because superseding functionality is unlikely to
be widely available yet, there are however niche or vendor-specific
extensions that have been replaced by more common EXT/KHR extensions
or even stabilized features.  These would benefit from nudging the user
towards the newer and/or cross-platform functionality which is more
likely to be prevalent.
@MarijnS95
Copy link
Copy Markdown
Collaborator Author

MarijnS95 commented May 6, 2026

Semi-draft because:

  • Unsure if this is enough weight for #[deprecated] versus a doc-comment;
  • promotedto is not yet handled;
  • Some of these attributes are empty on the vk.xml side, resulting in an "ugly" message here;
  • Call-sites still need to be updated with allow(deprecated) noise in that case.

Comment thread ash/src/vk/extensions.rs
#[deprecated = "Deprecated by "]
pub const NV_GLSL_SHADER_NAME: &CStr =
unsafe { CStr::from_bytes_with_nul_unchecked(b"VK_NV_glsl_shader\0") };
#[deprecated = "Deprecated by "]
Copy link
Copy Markdown
Collaborator

@Ralith Ralith May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something not right here and just above.

e: oh, yeah, you noticed too

@Ralith
Copy link
Copy Markdown
Collaborator

Ralith commented May 6, 2026

vulkan.hpp's use of this pattern gives me some confidence that it won't be hugely disruptive.

@MarijnS95
Copy link
Copy Markdown
Collaborator Author

Alternatively this could be hidden behind the same cfg_attr(feature = "pedantic_deprecated", deprecated = ...) that I described in #1038 (comment).

@MarijnS95 MarijnS95 added this to the Ash 0.39 with Vulkan 1.4 milestone May 8, 2026
@Ralith
Copy link
Copy Markdown
Collaborator

Ralith commented May 9, 2026

I think extensions are usually replaced with other extensions (or core functionality) that's supported in the same places modulo driver updates, and references to extension names also aren't scattered broadly across a code base so it's easy for folks who really need to support old drivers to disable the lint, so a real deprecation annotation is less disruptive here than elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants