Skip to content

spirv-std-const-generics crate to enable adt_const_params use - #636

Draft
Firestar99 wants to merge 3 commits into
mainfrom
const-generics-spirv-std
Draft

spirv-std-const-generics crate to enable adt_const_params use#636
Firestar99 wants to merge 3 commits into
mainfrom
const-generics-spirv-std

Conversation

@Firestar99

@Firestar99 Firestar99 commented Aug 4, 2026

Copy link
Copy Markdown
Member

Counterproposal to @nazar-pc's PR #635

PR #635 is modifying spirv-std to use adt_const_params, which would break for anyone using a CPU-GPU shared crate that depends on spirv-std where the CPU target is compiled with stable. It would also be a significant breaking change, with any crate using those functions needing to be manually migrated.

This PR introduces the new crate spirv-std-const-generics, which reexports the entirety of spirv-std, but replaces individual functions with const-generic replacements. It should thus be equivalent to PR #635 but not break any existing setups. Instead, it's a drop-in replacement with a simple use spirv_std_const_generics as spirv_std in any crate. (Though any crate doing so will obviously no longer compile on stable.) You can also mix and match both spirv-std crates and it should work just fine.

Note on publishing: Our release-plz setup can only update existing crates, I'd need to claim the name and do some setup before we release. But I first want to know if we're claiming that name or if we want to rename the crate beforehand.

close #607
close #414

@Firestar99 Firestar99 changed the title spirv-std-const-generics crate spirv-std-const-generics crate to enable adt_const_params use Aug 4, 2026
@nazar-pc

nazar-pc commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

That is a creative workaround, but I guess better than not supporting stable at all

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.

Make Scope and Semantics normal arguments rather than const generics Consider adt_const_params for intrinsics

2 participants