@@ -67,7 +67,7 @@ fn extract_wireframe_config(mut commands: Commands, wireframe_config: Res<Wirefr
67
67
}
68
68
}
69
69
70
- fn extract_wireframes ( mut commands : Commands , query : Query < ( Entity , Read < Wireframe > ) > ) {
70
+ fn extract_wireframes ( mut commands : Commands , query : Query < ( Entity , & Wireframe ) > ) {
71
71
for ( entity, wireframe) in query. iter ( ) {
72
72
commands. get_or_spawn ( entity) . insert ( wireframe. clone ( ) ) ;
73
73
}
@@ -113,6 +113,8 @@ fn prepare_wireframes(
113
113
. write_buffer ( & render_device, & render_queue) ;
114
114
}
115
115
116
+ /// Internal [`WireframePlugin`] resource.
117
+ /// [`GlobalWireframeBindGroup`] stores the [`BindGroup`] of wireframe data that is used on the GPU side.
116
118
pub struct GlobalWireframeBindGroup {
117
119
pub bind_group : BindGroup ,
118
120
}
@@ -173,15 +175,21 @@ impl Default for WireframeConfig {
173
175
}
174
176
}
175
177
178
+ /// Internal [`WireframePlugin`] component.
179
+ /// [`WireframeUniformOffset`] holds the offset of a [`WireframeUniform`] in the [`GlobalWireframeMeta::uniforms`].
176
180
#[ derive( Component , Copy , Clone , Debug , Default ) ]
177
181
#[ repr( transparent) ]
178
- pub struct WireframeUniformOffset ( u32 ) ;
182
+ pub struct WireframeUniformOffset ( pub u32 ) ;
179
183
184
+ /// Internal [`WireframePlugin`] state.
185
+ /// [`WireframeUniform`] is the GPU representation of a [`Wireframe`].
180
186
#[ derive( Debug , AsStd140 ) ]
181
187
pub struct WireframeUniform {
182
188
pub color : Vec4 ,
183
189
}
184
190
191
+ /// Internal [`WireframePlugin`] resource.
192
+ /// This is the GPU representation of a [`Wireframe`].
185
193
#[ derive( Component ) ]
186
194
pub struct GlobalWireframeMeta {
187
195
pub uniforms : DynamicUniformVec < WireframeUniform > ,
@@ -216,6 +224,8 @@ impl FromWorld for GlobalWireframeMeta {
216
224
}
217
225
}
218
226
227
+ /// Internal [`WireframePlugin`] resource.
228
+ /// [`WireframePipeline`] is the specialized rendering pipeline for wireframes.
219
229
pub struct WireframePipeline {
220
230
mesh_pipeline : MeshPipeline ,
221
231
wireframe_bind_group_layout : BindGroupLayout ,
@@ -303,6 +313,8 @@ fn queue_wireframes(
303
313
}
304
314
}
305
315
316
+ /// Internal [`WireframePlugin`] render command.
317
+ /// [`SetWireframeBindGroup`]`<bindgroup index>` binds the [`GlobalWireframeBindGroup`] there.
306
318
pub struct SetWireframeBindGroup < const I : usize > ;
307
319
impl < const I : usize > EntityRenderCommand for SetWireframeBindGroup < I > {
308
320
type Param = (
0 commit comments