@@ -8,10 +8,7 @@ use crate::{
88} ;
99use bevy_asset:: Handle ;
1010use bevy_core_pipeline:: core_3d:: Transparent3d ;
11- use bevy_ecs:: {
12- prelude:: * ,
13- system:: { lifetimeless:: * , SystemParamItem } ,
14- } ;
11+ use bevy_ecs:: prelude:: * ;
1512use bevy_math:: { Mat4 , UVec3 , UVec4 , Vec2 , Vec3 , Vec3Swizzles , Vec4 , Vec4Swizzles } ;
1613use bevy_render:: {
1714 camera:: Camera ,
@@ -20,13 +17,12 @@ use bevy_render::{
2017 render_asset:: RenderAssets ,
2118 render_graph:: { Node , NodeRunError , RenderGraphContext , SlotInfo , SlotType } ,
2219 render_phase:: {
23- CachedRenderPipelinePhaseItem , DrawFunctionId , DrawFunctions , PhaseItem , RenderCommand ,
24- RenderCommandResult , RenderPhase , TrackedRenderPass ,
20+ CachedRenderPipelinePhaseItem , DrawFunctionId , DrawFunctions , PhaseItem , RenderPhase ,
2521 } ,
2622 render_resource:: * ,
2723 renderer:: { RenderContext , RenderDevice , RenderQueue } ,
2824 texture:: * ,
29- view:: { ComputedVisibility , ExtractedView , ViewUniformOffset , ViewUniforms , VisibleEntities } ,
25+ view:: { ComputedVisibility , ExtractedView , VisibleEntities } ,
3026 Extract ,
3127} ;
3228use bevy_transform:: { components:: GlobalTransform , prelude:: Transform } ;
@@ -579,7 +575,6 @@ impl GlobalLightMeta {
579575#[ derive( Resource , Default ) ]
580576pub struct LightMeta {
581577 pub view_gpu_lights : DynamicUniformBuffer < GpuLights > ,
582- pub shadow_view_bind_group : Option < BindGroup > ,
583578}
584579
585580#[ derive( Component ) ]
@@ -1549,25 +1544,6 @@ pub fn prepare_clusters(
15491544 }
15501545}
15511546
1552- pub fn queue_shadow_view_bind_group < M : Material > (
1553- render_device : Res < RenderDevice > ,
1554- prepass_pipeline : Res < PrepassPipeline < M > > ,
1555- mut light_meta : ResMut < LightMeta > ,
1556- view_uniforms : Res < ViewUniforms > ,
1557- ) {
1558- if let Some ( view_binding) = view_uniforms. uniforms . binding ( ) {
1559- light_meta. shadow_view_bind_group =
1560- Some ( render_device. create_bind_group ( & BindGroupDescriptor {
1561- entries : & [ BindGroupEntry {
1562- binding : 0 ,
1563- resource : view_binding,
1564- } ] ,
1565- label : Some ( "shadow_view_bind_group" ) ,
1566- layout : & prepass_pipeline. view_layout ,
1567- } ) ) ;
1568- }
1569- }
1570-
15711547#[ allow( clippy:: too_many_arguments) ]
15721548pub fn queue_shadows < M : Material > (
15731549 shadow_draw_functions : Res < DrawFunctions < Shadow > > ,
@@ -1772,31 +1748,3 @@ impl Node for ShadowPassNode {
17721748 Ok ( ( ) )
17731749 }
17741750}
1775-
1776- pub struct SetShadowViewBindGroup < const I : usize > ;
1777- impl < const I : usize > RenderCommand < Shadow > for SetShadowViewBindGroup < I > {
1778- type Param = SRes < LightMeta > ;
1779- type ViewWorldQuery = Read < ViewUniformOffset > ;
1780- type ItemWorldQuery = ( ) ;
1781-
1782- #[ inline]
1783- fn render < ' w > (
1784- _item : & Shadow ,
1785- view_uniform_offset : & ' _ ViewUniformOffset ,
1786- _entity : ( ) ,
1787- light_meta : SystemParamItem < ' w , ' _ , Self :: Param > ,
1788- pass : & mut TrackedRenderPass < ' w > ,
1789- ) -> RenderCommandResult {
1790- pass. set_bind_group (
1791- I ,
1792- light_meta
1793- . into_inner ( )
1794- . shadow_view_bind_group
1795- . as_ref ( )
1796- . unwrap ( ) ,
1797- & [ view_uniform_offset. offset ] ,
1798- ) ;
1799-
1800- RenderCommandResult :: Success
1801- }
1802- }
0 commit comments