Uh oh!
There was an error while loading. Please reload this page.
spirv-std-nightly crate to enable adt_const_params use - #636
Conversation
spirv-std-const-generics cratespirv-std-const-generics crate to enable adt_const_params usenazar-pc
commented
Aug 4, 2026
That is a creative workaround, but I guess better than not supporting stable at all |
nazar-pc
commented
Aug 6, 2026
The biggest question I have about this is the name. Const generics is one thing, but maybe there will be other nightly features that would be beneficial, then current naming will not scale. Maybe |
LegNeato
commented
Aug 6, 2026
Can't we just gate code to nightlies with the feature we need? I think serde does something similar...they turn on and off code on different channels and different versions |
nazar-pc
commented
Aug 7, 2026
Possible, but then these APIs will have to go into the submodule or something. Right now it is more like "this is what some future version of spirv-std will look like". |
EDIT: fixed Rebased it on main and renamed the crate to The bitflags v2 update in #637 broke this PR. In bitflags v1 we had |
ecc6db6 to
5331e45Comparespirv-std-const-generics crate to enable adt_const_params usespirv-std-nightly crate to enable adt_const_params use5331e45 to
dc2f01fComparenazar-pc
commented
Aug 7, 2026
Hm... how important is it to depend on |
Firestar99
commented
Aug 7, 2026
Bitflags is the standard crate for bitflags, wouldn't really want to replace it. Also I think there's a decent chance they'd take a PR adding that behind a feature gate. |
dc2f01f to
b09e4cfCompareThat is just perfect derive issue. Simply replace derive with UPD: Hm... maybe not. I really don't like fight external crates for simple things 😕 |
…t_exprs` feature is failing
…eneric_const_exprs`
b09e4cf to
37a4d10CompareFirestar99
commented
Aug 7, 2026
Found a workaround: The |
Counterproposal to @nazar-pc's PR #635
PR #635 is modifying
spirv-stdto useadt_const_params, which would break for anyone using a CPU-GPU shared crate that depends onspirv-stdwhere 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-nightly, which reexports the entirety ofspirv-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 simpleuse spirv_std_nightly as spirv_stdin any crate. (Though any crate doing so will obviously no longer compile on stable.) You can also mix and match bothspirv-stdcrates 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