1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00
Files
egui/crates/egui_extras/Cargo.toml
Ted de Munnik 3af907919b Use profiling crate to support more profiler backends (#5150)
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

![image](https://github.com/user-attachments/assets/49fc0e7e-8f88-40cb-a69e-74ca2e3f90f3)
2024-12-16 09:15:54 +01:00

105 lines
2.7 KiB
TOML

[package]
name = "egui_extras"
version.workspace = true
authors = [
"Dominik Rössler <dominik@freshx.de>",
"Emil Ernerfeldt <emil.ernerfeldt@gmail.com>",
"René Rössler <rene@freshx.de>",
]
description = "Extra functionality and widgets for the egui GUI library"
edition.workspace = true
rust-version.workspace = true
homepage = "https://github.com/emilk/egui"
license.workspace = true
readme = "README.md"
repository = "https://github.com/emilk/egui"
categories = ["gui", "game-development"]
keywords = ["gui", "imgui", "immediate", "portable", "gamedev"]
include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"]
[lints]
workspace = true
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--generate-link-to-definition"]
[lib]
[features]
default = ["dep:mime_guess2"]
## Shorthand for enabling the different types of image loaders (`file`, `http`, `image`, `svg`).
all_loaders = ["file", "http", "image", "svg", "gif"]
## Enable [`DatePickerButton`] widget.
datepicker = ["chrono"]
## Add support for loading images from `file://` URIs.
file = ["dep:mime_guess2"]
## Support loading gif images.
gif = ["image", "image/gif"]
## Add support for loading images via HTTP.
http = ["dep:ehttp"]
## Add support for loading images with the [`image`](https://docs.rs/image) crate.
##
## You also need to ALSO opt-in to the image formats you want to support, like so:
## ```toml
## image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for
## ```
image = ["dep:image"]
## Derive serde Serialize/Deserialize on stateful structs
serde = ["egui/serde", "dep:serde"]
## Support loading svg images.
svg = ["resvg"]
## Enable better syntax highlighting using [`syntect`](https://docs.rs/syntect).
syntect = ["dep:syntect"]
[dependencies]
egui = { workspace = true, default-features = false }
ahash.workspace = true
enum-map = { version = "2", features = ["serde"] }
log.workspace = true
profiling.workspace = true
#! ### Optional dependencies
# Serde for serializing state
serde = { workspace = true, optional = true }
# Date operations needed for datepicker widget
chrono = { version = "0.4", optional = true, default-features = false, features = [
"clock",
"js-sys",
"std",
"wasmbind",
] }
## Enable this when generating docs.
document-features = { workspace = true, optional = true }
image = { workspace = true, optional = true }
# file feature
mime_guess2 = { version = "2", optional = true, default-features = false }
syntect = { version = "5", optional = true, default-features = false, features = [
"default-fancy",
] }
# svg feature
resvg = { version = "0.37", optional = true, default-features = false }
# http feature
ehttp = { version = "0.5", optional = true, default-features = false }