Skip to content

Commit

Permalink
Profiling: More annotations/scoping
Browse files Browse the repository at this point in the history
  • Loading branch information
MeFisto94 committed Feb 9, 2025
1 parent 8182099 commit 1e3f52c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/physics/physics_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ impl PhysicsState {
self.app.upgrade().expect("Weak Pointer expired")
}

#[profiling::function]
pub fn update_fixed(&self, movement_relative: Vec3) -> CharacterMovementInformation {
let timestep = 1.0 / 60.0; // TODO: why does physics_simulator not have a timestep?

Expand Down Expand Up @@ -106,6 +107,7 @@ impl PhysicsState {
// TODO: Implement notifications via https://docs.rs/tokio/latest/tokio/sync/broadcast/index.html
// TODO: Collider with heightfield at low res or rather meshes? Mesh would have the benefit of
// already being in adt/whatever space. In the end, it should be a heightfield for performance reasons, though.
#[profiling::function]
fn delta_map(&self) {
// Find changed (i.e. added or removed) tiles. Currently, we don't go after interior changes.
let app = self.app();
Expand Down Expand Up @@ -197,6 +199,7 @@ impl PhysicsState {
})
}

#[profiling::function]
fn update_character(
&self,
collider: ColliderHandle,
Expand Down
6 changes: 5 additions & 1 deletion src/rendering/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ use rend3_routine::base::{
use rend3_routine::common::CameraSpecifier;
use rend3_routine::forward::ForwardRoutineArgs;
use rend3_routine::{clear, forward};
use winit::error::EventLoopError;
use sargerust_files::m2::types::{M2TextureFlags, M2TextureType};
use winit::error::EventLoopError;
use winit::event::{ElementState, KeyEvent, WindowEvent};
use winit::event_loop::EventLoop;
use winit::keyboard::{KeyCode, PhysicalKey};
Expand Down Expand Up @@ -195,6 +195,7 @@ impl RenderingApplication {
))
}

#[profiling::function]
fn update_tile_graph(&self, renderer: &Arc<Renderer>, _tile_pos: (u8, u8), graph: &Arc<ADTNode>) {
// TODO: All this doesn't have to happen on the render thread. It could even happen inside of
// map_manager with interior knowledge of what has changed. One could even chain the
Expand All @@ -209,6 +210,7 @@ impl RenderingApplication {
self.update_tile_graph(renderer, tile_pos, graph);
}

#[profiling::function]
fn load_wmos(&self, renderer: &Arc<Renderer>, graph: &Arc<ADTNode>) {
for wmo_ref in &graph.wmos {
let wmo = {
Expand Down Expand Up @@ -326,6 +328,7 @@ impl RenderingApplication {
}
}

#[profiling::function]
fn load_terrain_chunks(&self, renderer: &Arc<Renderer>, graph: &Arc<ADTNode>) {
for tile in &graph.terrain {
{
Expand Down Expand Up @@ -417,6 +420,7 @@ impl RenderingApplication {
}
}

#[profiling::function]
fn load_doodads(
&self,
renderer: &Arc<Renderer>,
Expand Down

0 comments on commit 1e3f52c

Please sign in to comment.