File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
benches/benches/bevy_render Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ fn compute_normals(c: &mut Criterion) {
54
54
} ) ;
55
55
} ) ;
56
56
57
- c. bench_function ( "face_weighted_normals " , |b| {
57
+ c. bench_function ( "angle_weighted_normals " , |b| {
58
58
b. iter_custom ( |iters| {
59
59
let mut total = Duration :: default ( ) ;
60
60
for _ in 0 ..iters {
@@ -70,11 +70,23 @@ fn compute_normals(c: &mut Criterion) {
70
70
} ) ;
71
71
} ) ;
72
72
73
- let new_mesh = || {
74
- new_mesh ( )
75
- . with_duplicated_vertices ( )
76
- . with_computed_flat_normals ( )
77
- } ;
73
+ c. bench_function ( "face_weighted_normals" , |b| {
74
+ b. iter_custom ( |iters| {
75
+ let mut total = Duration :: default ( ) ;
76
+ for _ in 0 ..iters {
77
+ let mut mesh = new_mesh ( ) ;
78
+ black_box ( mesh. attribute ( Mesh :: ATTRIBUTE_NORMAL ) ) ;
79
+ let start = Instant :: now ( ) ;
80
+ mesh. compute_face_weighted_normals ( ) ;
81
+ let end = Instant :: now ( ) ;
82
+ black_box ( mesh. attribute ( Mesh :: ATTRIBUTE_NORMAL ) ) ;
83
+ total += end. duration_since ( start) ;
84
+ }
85
+ total
86
+ } ) ;
87
+ } ) ;
88
+
89
+ let new_mesh = || new_mesh ( ) . with_duplicated_vertices ( ) ;
78
90
79
91
c. bench_function ( "flat_normals" , |b| {
80
92
b. iter_custom ( |iters| {
You can’t perform that action at this time.
0 commit comments