Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/crates/bevy_material/src/labels.rs
9341 views
1
use bevy_ecs::define_label;
2
use bevy_ecs::intern::Interned;
3
pub use bevy_material_macros::ShaderLabel;
4
5
define_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
SHADER_LABEL_INTERNER
12
);
13
14
/// A shorthand for `Interned<dyn RenderSubGraph>`.
15
pub type InternedShaderLabel = Interned<dyn ShaderLabel>;
16
17
pub use bevy_material_macros::DrawFunctionLabel;
18
19
define_label!(
20
#[diagnostic::on_unimplemented(
21
note = "consider annotating `{Self}` with `#[derive(DrawFunctionLabel)]`"
22
)]
23
/// Labels used to uniquely identify types of material shaders
24
DrawFunctionLabel,
25
DRAW_FUNCTION_LABEL_INTERNER
26
);
27
28
pub type InternedDrawFunctionLabel = Interned<dyn DrawFunctionLabel>;
29
30
// TODO: make this generic?
31
/// An identifier for a [`Draw`](https://docs.rs/bevy/latest/bevy/render/render_phase/trait.Draw.html)
32
/// function stored in [`DrawFunctions`](https://docs.rs/bevy/latest/bevy/render/render_phase/struct.DrawFunctions.html).
33
#[derive(Copy, Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Hash)]
34
pub struct DrawFunctionId(pub u32);
35
36