-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major version bump #51
Comments
I have two extremely-breaking-change ideas:
Using bitbybit in bevy is still contentious, but if we were to use it, here is how it would work: In my fork of bevy, I use bitbybit to define "shader keys". Shaders are pieces of code that run on the GPU, in bevy, they are written in the wgsl language. We have a special syntax in wgsl, using But here is the thing. We are making the shading in bevy extensible. This means we need to be able to embed a shader key into another one. I get it is currently impossible to do that with // Bevy definition
#[rustfmt::skip]
#[bitfield(u32, default: 0)]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MeshPipelineKey {
#[bit(0, rw)] pub hdr: bool,
// ...
#[bit(11, rw)] pub taa: bool,
#[bit(12, rw)] pub morph_targets: bool,
#[bits(13..=14, rw)] pub blend: BlendMode,
// ...
#[bits(24..=25, rw)] pub shadow_filter_method: Option<ShadowFilteringMethod>,
#[bits(26..=27, rw)] pub view_projection: ViewProjection,
}
// User extension
#[bitfield(u32, default: 0)]
pub struct CustomMeshExtensionKey {
#[bits(0..=27, rw)] pub mesh_key: MeshPipelineKey,
#[bit(28, rw)] pub custom_define1: bool,
#[bit(29, rw)] pub custom_define2: bool,
// ...
} |
@nicopap You should be able to use bitfields inside other bitfields, the "primitive" in the Making the associated constant accessible might be a good idea in any case. It should be pretty trivial since you can use the |
There are a couple of things that would be good to do in a major release so that the syntax can be tidied up:
experimental_builder_syntax
and always provide the builder.The text was updated successfully, but these errors were encountered: