Skip to content

Commit 0a40a47

Browse files
committed
Fixup meshlets.
1 parent 3f952a0 commit 0a40a47

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crates/bevy_pbr/src/meshlet/visibility_buffer_raster_node.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use bevy_ecs::prelude::*;
99
use bevy_math::UVec2;
1010
use bevy_render::{
1111
camera::ExtractedCamera,
12+
diagnostic::RecordDiagnostics,
1213
render_resource::*,
1314
renderer::{RenderContext, ViewQuery},
1415
view::{ViewDepthTexture, ViewUniformOffset},
@@ -77,8 +78,15 @@ pub fn meshlet_visibility_buffer_raster(
7778
return;
7879
};
7980

81+
let diagnostics = ctx.diagnostic_recorder();
82+
let diagnostics = diagnostics.as_deref();
83+
8084
ctx.command_encoder()
8185
.push_debug_group("meshlet_visibility_buffer_raster");
86+
let time_span = diagnostics.time_span(
87+
ctx.command_encoder(),
88+
"meshlet_visibility_buffer_raster",
89+
);
8290

8391
ctx.command_encoder().clear_buffer(
8492
&resource_manager.visibility_buffer_raster_cluster_prev_counts,
@@ -186,6 +194,7 @@ pub fn meshlet_visibility_buffer_raster(
186194
downsample_depth_second_pipeline,
187195
);
188196
ctx.command_encoder().pop_debug_group();
197+
time_span.end(ctx.command_encoder());
189198

190199
for light_entity in &lights.lights {
191200
let Ok((
@@ -211,6 +220,10 @@ pub fn meshlet_visibility_buffer_raster(
211220
"meshlet_visibility_buffer_raster: {}",
212221
shadow_view.pass_name
213222
));
223+
let time_span_shadow = diagnostics.time_span(
224+
ctx.command_encoder(),
225+
&format!("meshlet_visibility_buffer_raster: {}", shadow_view.pass_name),
226+
);
214227

215228
clear_visibility_buffer_pass(
216229
&mut ctx,
@@ -305,6 +318,7 @@ pub fn meshlet_visibility_buffer_raster(
305318
downsample_depth_second_shadow_view_pipeline,
306319
);
307320
ctx.command_encoder().pop_debug_group();
321+
time_span_shadow.end(ctx.command_encoder());
308322
}
309323
}
310324

0 commit comments

Comments
 (0)