Skip to content

Commit 1d6f55d

Browse files
committed
Remove Read, add docs for all pub types
1 parent 498006e commit 1d6f55d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

crates/bevy_pbr/src/wireframe.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fn extract_wireframe_config(mut commands: Commands, wireframe_config: Res<Wirefr
6767
}
6868
}
6969

70-
fn extract_wireframes(mut commands: Commands, query: Query<(Entity, Read<Wireframe>)>) {
70+
fn extract_wireframes(mut commands: Commands, query: Query<(Entity, &Wireframe)>) {
7171
for (entity, wireframe) in query.iter() {
7272
commands.get_or_spawn(entity).insert(wireframe.clone());
7373
}
@@ -113,6 +113,8 @@ fn prepare_wireframes(
113113
.write_buffer(&render_device, &render_queue);
114114
}
115115

116+
/// Internal [`WireframePlugin`] resource.
117+
/// [`GlobalWireframeBindGroup`] stores the [`BindGroup`] of wireframe data that is used on the GPU side.
116118
pub struct GlobalWireframeBindGroup {
117119
pub bind_group: BindGroup,
118120
}
@@ -173,15 +175,21 @@ impl Default for WireframeConfig {
173175
}
174176
}
175177

178+
/// Internal [`WireframePlugin`] component.
179+
/// [`WireframeUniformOffset`] holds the offset of a [`WireframeUniform`] in the [`GlobalWireframeMeta::uniforms`].
176180
#[derive(Component, Copy, Clone, Debug, Default)]
177181
#[repr(transparent)]
178-
pub struct WireframeUniformOffset(u32);
182+
pub struct WireframeUniformOffset(pub u32);
179183

184+
/// Internal [`WireframePlugin`] state.
185+
/// [`WireframeUniform`] is the GPU representation of a [`Wireframe`].
180186
#[derive(Debug, AsStd140)]
181187
pub struct WireframeUniform {
182188
pub color: Vec4,
183189
}
184190

191+
/// Internal [`WireframePlugin`] resource.
192+
/// This is the GPU representation of a [`Wireframe`].
185193
#[derive(Component)]
186194
pub struct GlobalWireframeMeta {
187195
pub uniforms: DynamicUniformVec<WireframeUniform>,
@@ -216,6 +224,8 @@ impl FromWorld for GlobalWireframeMeta {
216224
}
217225
}
218226

227+
/// Internal [`WireframePlugin`] resource.
228+
/// [`WireframePipeline`] is the specialized rendering pipeline for wireframes.
219229
pub struct WireframePipeline {
220230
mesh_pipeline: MeshPipeline,
221231
wireframe_bind_group_layout: BindGroupLayout,
@@ -303,6 +313,8 @@ fn queue_wireframes(
303313
}
304314
}
305315

316+
/// Internal [`WireframePlugin`] render command.
317+
/// [`SetWireframeBindGroup`]`<bindgroup index>` binds the [`GlobalWireframeBindGroup`] there.
306318
pub struct SetWireframeBindGroup<const I: usize>;
307319
impl<const I: usize> EntityRenderCommand for SetWireframeBindGroup<I> {
308320
type Param = (

0 commit comments

Comments
 (0)