Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Salva plugin profiling #64

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ salva3d = { path = "./build/salva3d" }
#rapier_testbed2d = { git = "https://github.com/dimforge/rapier", branch = "split_geom" }
#rapier_testbed3d = { git = "https://github.com/dimforge/rapier", branch = "split_geom" }

#rapier2d = { git = "https://github.com/dimforge/rapier" }
#rapier3d = { git = "https://github.com/dimforge/rapier" }
#rapier_testbed2d = { git = "https://github.com/dimforge/rapier" }
#rapier_testbed3d = { git = "https://github.com/dimforge/rapier" }

# rapier2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" }
# rapier3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" }
# rapier_testbed2d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" }
# rapier_testbed3d = { git = "https://github.com/dimforge/rapier", rev = "3b0d256" }

# rapier2d = { path = "../rapier/build/rapier2d" }
# rapier3d = { path = "../rapier/build/rapier3d" }
# rapier_testbed2d = { path = "../rapier/build/rapier_testbed2d" }
# rapier_testbed3d = { path = "../rapier/build/rapier_testbed3d" }
# rapier2d = { git = "https://github.com/dimforge/rapier" }
# rapier3d = { git = "https://github.com/dimforge/rapier" }
# rapier_testbed2d = { git = "https://github.com/dimforge/rapier" }
rapier_testbed3d = { git = "https://github.com/dimforge/rapier" }

rapier2d = { path = "../rapier/crates/rapier2d" }
# rapier3d = { path = "../rapier/crates/rapier3d" }
rapier_testbed2d = { path = "../rapier/crates/rapier_testbed2d" }
Vrixyz marked this conversation as resolved.
Show resolved Hide resolved
# rapier_testbed3d = { path = "../rapier/crates/rapier_testbed3d" }
22 changes: 11 additions & 11 deletions build/salva2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ keywords = ["physics", "dynamics", "particles", "fluids", "SPH"]
license = "Apache-2.0"
edition = "2021"

[lints]
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim3"))',
] }

[badges]
maintenance = { status = "actively-developed" }

Expand All @@ -33,11 +38,6 @@ parry = ["parry2d"]
wasm-bindgen = ["rapier2d/wasm-bindgen"]
graphics = ["bevy", "bevy_egui"]

[lints]
rust.unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(feature, values("dim3"))',
] }

[lib]
name = "salva2d"
path = "../../src/lib.rs"
Expand All @@ -53,23 +53,23 @@ instant = { version = "0.1", features = ["now"] }
rayon = { version = "1.8", optional = true }

nalgebra = "0.33"
parry2d = { version = "0.16", optional = true }
rapier2d = { version = "0.21", optional = true }
rapier_testbed2d = { version = "0.21", optional = true }
parry2d = { version = "0.17", optional = true }
rapier2d = { version = "0.22", optional = true }
rapier_testbed2d = { version = "0.22", optional = true }

bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true }
bevy_egui = { version = "0.29", features = ["immutable_ctx"], optional = true }
bitflags = "2"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13.2", default-features = false, features = [
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
"x11",
], optional = true }

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = [
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
], optional = true }
12 changes: 6 additions & 6 deletions build/salva3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ instant = { version = "0.1", features = ["now"] }
rayon = { version = "1.8", optional = true }

nalgebra = "0.33"
parry3d = { version = "0.16", optional = true }
rapier3d = { version = "0.21", optional = true }
rapier_testbed3d = { version = "0.21", optional = true }
parry3d = { version = "0.17", optional = true }
rapier3d = { version = "0.22", optional = true }
rapier_testbed3d = { version = "0.22", optional = true }

bevy_egui = { version = "0.26", features = ["immutable_ctx"], optional = true }
bevy_egui = { version = "0.29", features = ["immutable_ctx"], optional = true }
bitflags = "2.6.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
bevy = { version = "0.13", default-features = false, features = [
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
"x11",
], optional = true }

# Dependencies for WASM only.
[target.'cfg(target_arch = "wasm32")'.dependencies]
bevy = { version = "0.13", default-features = false, features = [
bevy = { version = "0.14", default-features = false, features = [
"bevy_winit",
"bevy_render",
], optional = true }
25 changes: 11 additions & 14 deletions examples2d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,32 @@
[package]
name = "examples2d"
name = "examples2d"
version = "0.1.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>"]
edition = "2018"

[features]
default = []
parallel = [ "rapier_testbed2d/parallel"]
parallel = ["rapier_testbed2d/parallel"]

[dependencies]
Inflector = "0.11"
nalgebra = "0.33"
parry2d = "0.16"
rapier2d = "0.21"
rapier_testbed2d = "0.21"
parry3d = "0.16"
bevy = "0.13.2"
Inflector = "0.11"
nalgebra = "0.33"
parry2d = "0.17"
rapier2d = "0.22"
rapier_testbed2d = "0.22"
parry3d = "0.17"
bevy = "0.14"

[dependencies.salva2d]
path = "../build/salva2d"
features = [ "rapier", "rapier-testbed", "sampling" ]
features = ["rapier", "rapier-testbed", "sampling"]

[target.wasm32-unknown-unknown.dependencies]
stdweb = "0.4"

[target.wasm32-unknown-emscripten.dependencies]
stdweb = "0.4"

[target.asmjs-unknown-emscripten.dependencies]
stdweb = "0.4"

[[bin]]
name = "all_examples2"
path = "./all_examples2.rs"
20 changes: 10 additions & 10 deletions examples3d/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
[package]
name = "examples3d"
name = "examples3d"
version = "0.1.0"
authors = [ "Sébastien Crozet <[email protected]>" ]
authors = ["Sébastien Crozet <[email protected]>"]
edition = "2018"

[features]
default = []
parallel = [ "rapier_testbed3d/parallel", "salva3d/parallel"]
parallel = ["rapier_testbed3d/parallel", "salva3d/parallel"]

[dependencies]
num-traits = "0.2"
Inflector = "0.11"
nalgebra = "0.33"
rapier3d = "0.21"
rapier_testbed3d = "0.21"
parry3d = "0.16"
bevy = "0.13.2"
Inflector = "0.11"
nalgebra = "0.33"
rapier3d = "0.22"
rapier_testbed3d = "0.22"
parry3d = "0.17"
bevy = "0.14"

[dependencies.salva3d]
path = "../build/salva3d"
features = [ "rapier", "rapier-testbed", "sampling", "rapier-harness" ]
features = ["rapier", "rapier-testbed", "sampling", "rapier-harness"]

[target.wasm32-unknown-unknown.dependencies]
stdweb = "0.4"
Expand Down
14 changes: 13 additions & 1 deletion src/integrations/rapier/testbed_plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::math::{Isometry, Point, Real, Rotation, Translation, Vector};
use crate::object::{BoundaryHandle, FluidHandle};
use bevy::math::Quat;
use bevy::prelude::{Assets, Commands, Mesh, Query, Transform};
use bevy_egui::egui;
use bevy_egui::{egui::ComboBox, egui::Window, EguiContexts};
#[cfg(feature = "dim3")]
use na::Quaternion;
Expand Down Expand Up @@ -487,7 +488,18 @@ impl TestbedPlugin for FluidsTestbedPlugin {
|| changed;
}
});

let counters = self.fluids_pipeline.liquid_world.counters;
let _ = egui::CollapsingHeader::new(format!(
"Total: {:.2}ms - {} fps",
counters.step_time.time(),
(1000.0 / counters.step_time.time()).round()
))
.id_source("total_fluids")
.show(ui, |ui| {
let _ = ui.label(format!("{}", counters));
// // Ideally:
// p.profiling_ui(ui);
});
if changed {
// FIXME: not too sure what to do here for color
// let fluid_handle = self
Expand Down
Loading