Skip to main content

bevy_material/
labels.rs

1use bevy_ecs::define_label;
2use bevy_ecs::intern::Interned;
3pub use bevy_material_macros::ShaderLabel;
4
5define_label!(
6    #[diagnostic::on_unimplemented(
7        note = "consider annotating `{Self}` with `#[derive(ShaderLabel)]`"
8    )]
9    /// Labels used to uniquely identify types of material shaders
10    ShaderLabel,
11);
12
13/// A shorthand for `Interned<dyn RenderSubGraph>`.
14pub type InternedShaderLabel = Interned<dyn ShaderLabel>;
15
16pub use bevy_material_macros::DrawFunctionLabel;
17
18define_label!(
19    #[diagnostic::on_unimplemented(
20        note = "consider annotating `{Self}` with `#[derive(DrawFunctionLabel)]`"
21    )]
22    /// Labels used to uniquely identify types of material shaders
23    DrawFunctionLabel,
24);
25
26pub type InternedDrawFunctionLabel = Interned<dyn DrawFunctionLabel>;
27
28// TODO: make this generic?
29/// An identifier for a [`Draw`](https://docs.rs/bevy/latest/bevy/render/render_phase/trait.Draw.html)
30/// function stored in [`DrawFunctions`](https://docs.rs/bevy/latest/bevy/render/render_phase/struct.DrawFunctions.html).
31#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
32pub struct DrawFunctionId(pub u32);