@@ -14,27 +14,27 @@ use bevy_render::{
14
14
render_phase:: { DrawFunctions , RenderPhase , SetItemPipeline } ,
15
15
render_resource:: * ,
16
16
texture:: BevyDefault ,
17
- view:: { ExtractedView , Msaa } ,
17
+ view:: Msaa ,
18
18
} ;
19
19
20
20
use crate :: { GizmoConfig , GizmoDrawMesh , SHADER_HANDLE } ;
21
21
22
22
#[ derive( Resource ) ]
23
- pub ( crate ) struct DebugLinePipeline {
23
+ pub ( crate ) struct GizmoLinePipeline {
24
24
mesh_pipeline : MeshPipeline ,
25
25
shader : Handle < Shader > ,
26
26
}
27
27
28
- impl FromWorld for DebugLinePipeline {
28
+ impl FromWorld for GizmoLinePipeline {
29
29
fn from_world ( render_world : & mut World ) -> Self {
30
- DebugLinePipeline {
30
+ GizmoLinePipeline {
31
31
mesh_pipeline : render_world. resource :: < MeshPipeline > ( ) . clone ( ) ,
32
32
shader : SHADER_HANDLE . typed ( ) ,
33
33
}
34
34
}
35
35
}
36
36
37
- impl SpecializedMeshPipeline for DebugLinePipeline {
37
+ impl SpecializedMeshPipeline for GizmoLinePipeline {
38
38
type Key = ( bool , MeshPipelineKey ) ;
39
39
40
40
fn specialize (
@@ -125,7 +125,7 @@ impl SpecializedMeshPipeline for DebugLinePipeline {
125
125
}
126
126
}
127
127
128
- pub ( crate ) type DrawDebugLines = (
128
+ pub ( crate ) type DrawGizmoLines = (
129
129
SetItemPipeline ,
130
130
SetMeshViewBindGroup < 0 > ,
131
131
SetMeshBindGroup < 1 > ,
@@ -135,20 +135,19 @@ pub(crate) type DrawDebugLines = (
135
135
#[ allow( clippy:: too_many_arguments) ]
136
136
pub ( crate ) fn queue (
137
137
draw_functions : Res < DrawFunctions < Opaque3d > > ,
138
- pipeline : Res < DebugLinePipeline > ,
139
- mut pipelines : ResMut < SpecializedMeshPipelines < DebugLinePipeline > > ,
138
+ pipeline : Res < GizmoLinePipeline > ,
139
+ mut pipelines : ResMut < SpecializedMeshPipelines < GizmoLinePipeline > > ,
140
140
mut pipeline_cache : ResMut < PipelineCache > ,
141
141
render_meshes : Res < RenderAssets < Mesh > > ,
142
142
msaa : Res < Msaa > ,
143
- material_meshes : Query < ( Entity , & Handle < Mesh > ) , With < GizmoDrawMesh > > ,
143
+ mesh_handles : Query < ( Entity , & Handle < Mesh > ) , With < GizmoDrawMesh > > ,
144
144
config : Res < GizmoConfig > ,
145
- mut views : Query < ( & ExtractedView , & mut RenderPhase < Opaque3d > ) > ,
145
+ mut views : Query < & mut RenderPhase < Opaque3d > > ,
146
146
) {
147
- let draw_function = draw_functions. read ( ) . get_id :: < DrawDebugLines > ( ) . unwrap ( ) ;
147
+ let draw_function = draw_functions. read ( ) . get_id :: < DrawGizmoLines > ( ) . unwrap ( ) ;
148
148
let key = MeshPipelineKey :: from_msaa_samples ( msaa. samples ) ;
149
- for ( view, mut phase) in & mut views {
150
- let view_matrix = view. transform . compute_matrix ( ) ;
151
- for ( entity, mesh_handle) in & material_meshes {
149
+ for mut phase in & mut views {
150
+ for ( entity, mesh_handle) in & mesh_handles {
152
151
if let Some ( mesh) = render_meshes. get ( mesh_handle) {
153
152
let key = key | MeshPipelineKey :: from_primitive_topology ( mesh. primitive_topology ) ;
154
153
let pipeline = pipelines
0 commit comments