Skip to content

Commit 78beb71

Browse files
committed
disable v-sync, add warning, appease clippy
1 parent 2ef4b4f commit 78beb71

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

crates/bevy_debug_draw/src/debug_draw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl DebugDraw {
9393
let br = (position + rotation * vec3(half_size.x, -half_size.y, 0.)).to_array();
9494
self.positions.extend([tl, tr, tr, br, br, bl, bl, tl]);
9595
self.colors
96-
.extend(std::iter::repeat(color.as_linear_rgba_f32()).take(8))
96+
.extend(std::iter::repeat(color.as_linear_rgba_f32()).take(8));
9797
}
9898

9999
/// Draw a box.
@@ -115,7 +115,7 @@ impl DebugDraw {
115115
tlf, tlb, trf, trb, brf, brb, blf, blb, // Front to back
116116
]);
117117
self.colors
118-
.extend(std::iter::repeat(color.as_linear_rgba_f32()).take(24))
118+
.extend(std::iter::repeat(color.as_linear_rgba_f32()).take(24));
119119
}
120120

121121
/// Draw a line from `start` to `end`.

crates/bevy_debug_draw/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ fn update(
105105
mut meshes: ResMut<Assets<Mesh>>,
106106
mut commands: Commands,
107107
) {
108-
if let Some(mut mesh) = debug_draw
108+
if let Some(mesh) = debug_draw
109109
.mesh_handle
110110
.as_ref()
111111
.and_then(|handle| meshes.get_mut(handle))
112112
{
113113
if config.enabled {
114-
debug_draw.update_mesh(&mut mesh);
114+
debug_draw.update_mesh(mesh);
115115
} else {
116116
debug_draw.clear();
117117
mesh.remove_attribute(Mesh::ATTRIBUTE_POSITION);

crates/bevy_debug_draw/src/pipeline_2d.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ pub(crate) type DrawDebugLines = (
9191
DrawMesh2d,
9292
);
9393

94+
#[allow(clippy::too_many_arguments)]
9495
pub(crate) fn queue(
9596
config: Res<DebugDrawConfig>,
9697
draw2d_functions: Res<DrawFunctions<Transparent2d>>,

crates/bevy_debug_draw/src/pipeline_3d.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ pub(crate) type DrawDebugLines = (
128128
DrawMesh,
129129
);
130130

131+
#[allow(clippy::too_many_arguments)]
131132
pub(crate) fn queue(
132133
opaque_3d_draw_functions: Res<DrawFunctions<Opaque3d>>,
133134
debug_line_pipeline: Res<DebugLinePipeline>,

examples/stress_tests/many_debug_lines.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ use std::f32::consts::TAU;
33
use bevy::{
44
diagnostic::{Diagnostics, FrameTimeDiagnosticsPlugin},
55
prelude::*,
6+
window::PresentMode,
67
};
78

89
fn main() {
910
App::new()
10-
.add_plugins(DefaultPlugins)
11+
.add_plugins(DefaultPlugins.set(WindowPlugin {
12+
window: WindowDescriptor {
13+
title: "Many Debug Lines".to_string(),
14+
present_mode: PresentMode::AutoNoVsync,
15+
..default()
16+
},
17+
..default()
18+
}))
1119
.add_plugin(FrameTimeDiagnosticsPlugin::default())
1220
.insert_resource(Config {
1321
line_count: 50_000,
@@ -63,6 +71,8 @@ fn system(
6371
}
6472

6573
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
74+
warn!(include_str!("warning_string.txt"));
75+
6676
commands.spawn(Camera3dBundle {
6777
transform: Transform::from_xyz(3., 1., 5.).looking_at(Vec3::ZERO, Vec3::Y),
6878
..default()

0 commit comments

Comments
 (0)