mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
Hey! I am not sure if this is something that's been considered before and decided against (I couldn't find any PR's or issues). This change removes the internal profiling macros in library crates and the `puffin` feature and replaces it with similar functions in the [profiling](https://github.com/aclysma/profiling) crate. This crate provides a layer of abstraction over various profiler instrumentation crates and allows library users to pick their favorite (supported) profiler. An additional benefit for puffin users is that dependencies of egui are included in the instrumentation output too (mainly wgpu which uses the profiling crate), so more details might be available when profiling. A breaking change is that instead of using the `puffin` feature on egui, users that want to profile the crate with puffin instead have to enable the `profile-with-puffin` feature on the profiling crate. Similarly they could instead choose to use `profile-with-tracy` etc. I tried to add a 'tracy' feature to egui_demo_app in order to showcase , however the /scripts/check.sh currently breaks on mutually exclusive features (which this introduces), so I decided against including it for the initial PR. I'm happy to iterate more on this if there is interest in taking this PR though. Screenshot showing the additional info for wgpu now available when using puffin 
69 lines
2.2 KiB
TOML
69 lines
2.2 KiB
TOML
[package]
|
|
name = "egui-wgpu"
|
|
version.workspace = true
|
|
description = "Bindings for using egui natively using the wgpu library"
|
|
authors = [
|
|
"Nils Hasenbanck <nils@hasenbanck.de>",
|
|
"embotech <opensource@embotech.com>",
|
|
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
|
|
]
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
homepage = "https://github.com/emilk/egui/tree/master/crates/egui-wgpu"
|
|
license.workspace = true
|
|
readme = "README.md"
|
|
repository = "https://github.com/emilk/egui/tree/master/crates/egui-wgpu"
|
|
categories = ["gui", "game-development"]
|
|
keywords = ["wgpu", "egui", "gui", "gamedev"]
|
|
include = [
|
|
"../LICENSE-APACHE",
|
|
"../LICENSE-MIT",
|
|
"**/*.rs",
|
|
"**/*.wgsl",
|
|
"Cargo.toml",
|
|
]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
rustdoc-args = ["--generate-link-to-definition"]
|
|
|
|
[features]
|
|
default = ["fragile-send-sync-non-atomic-wasm"]
|
|
|
|
## Enable [`winit`](https://docs.rs/winit) integration. On Linux, requires either `wayland` or `x11`
|
|
winit = ["dep:winit", "winit/rwh_06"]
|
|
|
|
## Enables Wayland support for winit.
|
|
wayland = ["winit?/wayland"]
|
|
|
|
## Enables x11 support for winit.
|
|
x11 = ["winit?/x11"]
|
|
|
|
## Make the renderer `Sync` on wasm, exploiting that by default wasm isn't multithreaded.
|
|
## It may make code easier, expecially when targeting both native and web.
|
|
## On native most wgpu objects are send and sync, on the web they are not (by nature of the WebGPU specification).
|
|
## This is not supported in [multithreaded WASM](https://gpuweb.github.io/gpuweb/explainer/#multithreading-transfer).
|
|
## Thus that usage is guarded against with compiler errors in wgpu.
|
|
fragile-send-sync-non-atomic-wasm = ["wgpu/fragile-send-sync-non-atomic-wasm"]
|
|
|
|
[dependencies]
|
|
egui = { workspace = true, default-features = false }
|
|
epaint = { workspace = true, default-features = false, features = ["bytemuck"] }
|
|
|
|
ahash.workspace = true
|
|
bytemuck.workspace = true
|
|
document-features.workspace = true
|
|
log.workspace = true
|
|
profiling.workspace = true
|
|
thiserror.workspace = true
|
|
type-map.workspace = true
|
|
web-time.workspace = true
|
|
wgpu = { workspace = true, features = ["wgsl"] }
|
|
|
|
# Optional dependencies:
|
|
|
|
winit = { workspace = true, optional = true, default-features = false }
|