Skip to content
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

Composable Pipeline Specialization #17373

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/bevy_render/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
mod as_bind_group;
mod extract_component;
mod extract_resource;
mod specialize;

use bevy_macro_utils::{derive_label, BevyManifest};
use proc_macro::TokenStream;
Expand Down Expand Up @@ -107,3 +108,18 @@ pub fn derive_render_sub_graph(input: TokenStream) -> TokenStream {
dyn_eq_path.segments.push(format_ident!("DynEq").into());
derive_label(input, "RenderSubGraph", &trait_path, &dyn_eq_path)
}

/// Derive macro generating an impl of the trait `Specialize`
///
/// This only works for structs whose members all implement `Specialize`
#[proc_macro_derive(Specialize, attributes(specialize, key))]
pub fn derive_specialize(input: TokenStream) -> TokenStream {
specialize::impl_specialize(input)
}

/// Derive macro generating an impl of the trait `HasBaseDescriptor`
/// by deferring to the `HasBaseDescriptor` impl of a chosen field.
#[proc_macro_derive(HasBaseDescriptor, attributes(specialize, base_descriptor))]
pub fn derive_has_base_descriptor(input: TokenStream) -> TokenStream {
specialize::impl_has_base_descriptor(input)
}
Loading
Loading