Skip to content

Commit 645a2a6

Browse files
committed
Use Default::default() where possible in RenderPipelineDescriptor
1 parent 62cfa9e commit 645a2a6

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

crates/bevy_gizmos/src/pipeline_2d.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,8 @@ impl SpecializedMeshPipeline for GizmoPipeline2d {
6666
}),
6767
layout: vec![self.mesh_pipeline.view_layout.clone()],
6868
primitive: PrimitiveState {
69-
front_face: FrontFace::Ccw,
70-
cull_mode: None,
71-
unclipped_depth: false,
72-
polygon_mode: PolygonMode::Fill,
73-
conservative: false,
7469
topology: key.primitive_topology(),
75-
strip_index_format: None,
70+
..Default::default()
7671
},
7772
depth_stencil: None,
7873
multisample: MultisampleState {

crates/bevy_gizmos/src/pipeline_3d.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,15 @@ impl SpecializedMeshPipeline for GizmoPipeline3d {
9797
}),
9898
layout: bind_group_layout,
9999
primitive: PrimitiveState {
100-
front_face: FrontFace::Ccw,
101-
cull_mode: None,
102-
unclipped_depth: false,
103-
polygon_mode: PolygonMode::Fill,
104-
conservative: false,
105100
topology: key.primitive_topology(),
106-
strip_index_format: None,
101+
..Default::default()
107102
},
108103
depth_stencil: Some(DepthStencilState {
109104
format: TextureFormat::Depth32Float,
110105
depth_write_enabled: false,
111106
depth_compare: CompareFunction::Greater,
112-
stencil: StencilState {
113-
front: StencilFaceState::IGNORE,
114-
back: StencilFaceState::IGNORE,
115-
read_mask: 0,
116-
write_mask: 0,
117-
},
118-
bias: DepthBiasState {
119-
constant: 0,
120-
slope_scale: 0.0,
121-
clamp: 0.0,
122-
},
107+
stencil: Default::default(),
108+
bias: Default::default(),
123109
}),
124110
multisample: MultisampleState {
125111
count: key.msaa_samples(),

0 commit comments

Comments
 (0)