1
1
pub mod visibility;
2
2
pub mod window;
3
3
4
+ use bevy_asset:: { load_internal_asset, HandleUntyped } ;
4
5
pub use visibility:: * ;
5
6
pub use window:: * ;
6
7
7
8
use crate :: {
8
9
camera:: ExtractedCamera ,
9
10
extract_resource:: { ExtractResource , ExtractResourcePlugin } ,
10
- prelude:: Image ,
11
+ prelude:: { Image , Shader } ,
11
12
render_asset:: RenderAssets ,
12
13
render_phase:: ViewRangefinder3d ,
13
14
render_resource:: { DynamicUniformBuffer , ShaderType , Texture , TextureView } ,
@@ -18,7 +19,7 @@ use crate::{
18
19
use bevy_app:: { App , Plugin } ;
19
20
use bevy_ecs:: prelude:: * ;
20
21
use bevy_math:: { Mat4 , UVec4 , Vec3 , Vec4 } ;
21
- use bevy_reflect:: Reflect ;
22
+ use bevy_reflect:: { Reflect , TypeUuid } ;
22
23
use bevy_transform:: components:: GlobalTransform ;
23
24
use bevy_utils:: HashMap ;
24
25
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -27,10 +28,15 @@ use wgpu::{
27
28
TextureFormat , TextureUsages ,
28
29
} ;
29
30
31
+ pub const VIEW_TYPE_HANDLE : HandleUntyped =
32
+ HandleUntyped :: weak_from_u64 ( Shader :: TYPE_UUID , 15421373904451797197 ) ;
33
+
30
34
pub struct ViewPlugin ;
31
35
32
36
impl Plugin for ViewPlugin {
33
37
fn build ( & self , app : & mut App ) {
38
+ load_internal_asset ! ( app, VIEW_TYPE_HANDLE , "view.wgsl" , Shader :: from_wgsl) ;
39
+
34
40
app. register_type :: < ComputedVisibility > ( )
35
41
. register_type :: < ComputedVisibilityFlags > ( )
36
42
. register_type :: < Msaa > ( )
0 commit comments