File tree 8 files changed +27
-22
lines changed
bevy_render/src/render_graph
8 files changed +27
-22
lines changed Original file line number Diff line number Diff line change @@ -3,24 +3,25 @@ use crate::{
3
3
} ;
4
4
pub use bevy_derive:: AppLabel ;
5
5
use bevy_ecs:: {
6
+ intern:: Interned ,
6
7
prelude:: * ,
7
8
schedule:: { ScheduleBuildSettings , ScheduleLabel } ,
8
9
system:: SystemId ,
9
10
} ;
10
11
#[ cfg( feature = "trace" ) ]
11
12
use bevy_utils:: tracing:: info_span;
12
- use bevy_utils:: { intern :: Interned , tracing:: debug, HashMap } ;
13
+ use bevy_utils:: { tracing:: debug, HashMap } ;
13
14
use std:: fmt:: Debug ;
14
15
use std:: panic:: { catch_unwind, resume_unwind, AssertUnwindSafe } ;
15
16
use thiserror:: Error ;
16
17
17
- bevy_utils :: define_label!(
18
+ bevy_ecs :: define_label!(
18
19
/// A strongly-typed class of labels used to identify an [`App`].
19
20
AppLabel ,
20
21
APP_LABEL_INTERNER
21
22
) ;
22
23
23
- pub use bevy_utils :: label:: DynEq ;
24
+ pub use bevy_ecs :: label:: DynEq ;
24
25
25
26
/// A shorthand for `Interned<dyn AppLabel>`.
26
27
pub type InternedAppLabel = Interned < dyn AppLabel > ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use std::{
11
11
sync:: { OnceLock , PoisonError , RwLock } ,
12
12
} ;
13
13
14
- use crate :: HashSet ;
14
+ use bevy_utils :: HashSet ;
15
15
16
16
/// An interned value. Will stay valid until the end of the program and will not drop.
17
17
///
@@ -26,7 +26,7 @@ use crate::HashSet;
26
26
// NOTE: This type must NEVER implement Borrow since it does not obey that trait's invariants.
27
27
///
28
28
/// ```
29
- /// # use bevy_utils ::intern::*;
29
+ /// # use bevy_ecs ::intern::*;
30
30
/// #[derive(PartialEq, Eq, Hash, Debug)]
31
31
/// struct Value(i32);
32
32
/// impl Internable for Value {
Original file line number Diff line number Diff line change 63
63
/// # Example
64
64
///
65
65
/// ```
66
- /// # use bevy_utils ::define_label;
66
+ /// # use bevy_ecs ::define_label;
67
67
/// define_label!(
68
68
/// /// Documentation of label trait
69
69
/// MyNewLabelTrait,
@@ -125,7 +125,7 @@ macro_rules! define_label {
125
125
/// Feeds this value into the given [`Hasher`].
126
126
fn dyn_hash( & self , state: & mut dyn :: std:: hash:: Hasher ) ;
127
127
128
- /// Returns an [`Interned`](bevy_utils::intern::Interned) value corresponding to `self`.
128
+ /// Returns an [`Interned`] value corresponding to `self`.
129
129
fn intern( & self ) -> $crate:: intern:: Interned <dyn $label_trait_name>
130
130
where Self : Sized {
131
131
$interner_name. intern( self )
@@ -175,7 +175,7 @@ macro_rules! define_label {
175
175
176
176
fn ref_eq( & self , other: & Self ) -> bool {
177
177
if self . as_dyn_eq( ) . type_id( ) == other. as_dyn_eq( ) . type_id( ) {
178
- ( self as * const Self as * const ( ) ) == ( other as * const Self as * const ( ) )
178
+ ( self as * const Self ) . cast :: < ( ) > ( ) == ( other as * const Self ) . cast :: < ( ) > ( )
179
179
} else {
180
180
false
181
181
}
@@ -184,7 +184,7 @@ macro_rules! define_label {
184
184
fn ref_hash<H : :: std:: hash:: Hasher >( & self , state: & mut H ) {
185
185
use :: std:: hash:: Hash ;
186
186
self . as_dyn_eq( ) . type_id( ) . hash( state) ;
187
- ( self as * const Self as * const ( ) ) . hash( state) ;
187
+ ( self as * const Self ) . cast :: < ( ) > ( ) . hash( state) ;
188
188
}
189
189
}
190
190
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ pub mod component;
18
18
pub mod entity;
19
19
pub mod event;
20
20
pub mod identifier;
21
+ pub mod intern;
22
+ pub mod label;
21
23
pub mod query;
22
24
#[ cfg( feature = "bevy_reflect" ) ]
23
25
pub mod reflect;
Original file line number Diff line number Diff line change @@ -3,18 +3,20 @@ use std::fmt::Debug;
3
3
use std:: hash:: { Hash , Hasher } ;
4
4
use std:: marker:: PhantomData ;
5
5
6
+ pub use crate :: label:: DynEq ;
6
7
pub use bevy_ecs_macros:: { ScheduleLabel , SystemSet } ;
7
- use bevy_utils:: define_label;
8
- use bevy_utils:: intern:: Interned ;
9
- pub use bevy_utils:: label:: DynEq ;
10
8
11
- use crate :: system:: {
12
- ExclusiveFunctionSystem , ExclusiveSystemParamFunction , FunctionSystem ,
13
- IsExclusiveFunctionSystem , IsFunctionSystem , SystemParamFunction ,
9
+ use crate :: {
10
+ define_label,
11
+ intern:: Interned ,
12
+ system:: {
13
+ ExclusiveFunctionSystem , ExclusiveSystemParamFunction , FunctionSystem ,
14
+ IsExclusiveFunctionSystem , IsFunctionSystem , SystemParamFunction ,
15
+ } ,
14
16
} ;
15
17
16
18
define_label ! (
17
- /// A strongly-typed class of labels used to identify an [`Schedule`].
19
+ /// A strongly-typed class of labels used to identify a [`Schedule`](crate::schedule::Schedule) .
18
20
ScheduleLabel ,
19
21
SCHEDULE_LABEL_INTERNER
20
22
) ;
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ use crate::{
5
5
} ,
6
6
renderer:: RenderContext ,
7
7
} ;
8
- use bevy_ecs:: { prelude:: World , system:: Resource } ;
9
- use bevy_utils:: { define_label , intern :: Interned , HashMap } ;
8
+ use bevy_ecs:: { define_label , intern :: Interned , prelude:: World , system:: Resource } ;
9
+ use bevy_utils:: HashMap ;
10
10
use std:: fmt:: Debug ;
11
11
12
12
use super :: { EdgeExistence , InternedRenderLabel , IntoRenderNodeArray } ;
Original file line number Diff line number Diff line change @@ -5,12 +5,14 @@ use crate::{
5
5
} ,
6
6
renderer:: RenderContext ,
7
7
} ;
8
+ pub use bevy_ecs:: label:: DynEq ;
8
9
use bevy_ecs:: {
10
+ define_label,
11
+ intern:: Interned ,
9
12
query:: { QueryItem , QueryState , ReadOnlyQueryData } ,
10
13
world:: { FromWorld , World } ,
11
14
} ;
12
- pub use bevy_utils:: label:: DynEq ;
13
- use bevy_utils:: { all_tuples_with_size, define_label, intern:: Interned } ;
15
+ use bevy_utils:: all_tuples_with_size;
14
16
use downcast_rs:: { impl_downcast, Downcast } ;
15
17
use std:: fmt:: Debug ;
16
18
use thiserror:: Error ;
Original file line number Diff line number Diff line change @@ -16,15 +16,13 @@ pub mod prelude {
16
16
}
17
17
18
18
pub mod futures;
19
- pub mod label;
20
19
mod short_names;
21
20
pub use short_names:: get_short_name;
22
21
pub mod synccell;
23
22
pub mod syncunsafecell;
24
23
25
24
mod cow_arc;
26
25
mod default;
27
- pub mod intern;
28
26
mod once;
29
27
mod parallel_queue;
30
28
You can’t perform that action at this time.
0 commit comments