bevy/docs/cargo_features.md
Robert Swain 064af63400 Add trace_tracy feature for Tracy profiling (#2832)
# Objective

[Tracy](https://github.com/wolfpld/tracy) is:
> A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.

With the `trace_tracy` feature enabled, you run your bevy app and either a headless server (`capture`) or a live, interactive profiler UI (`Tracy`), and connect that to your bevy application to then stream the metric data and events, and save it or inspect it live/offline.

Previously when I implemented the spans across systems and stages and I was trying out different profiling tools, Tracy was too unstable on macOS to use. But now, quite some months later, it is working stably with Tracy 0.7.8. You can see timelines, aggregate statistics of mean system/stage execution times, and much more. It's very useful!

![Screenshot_2021-09-15_at_18 07 19](https://user-images.githubusercontent.com/302146/133554920-350d3d45-fbb8-479f-91f7-7a7a4f9f5873.png)

## Solution

- Use the `tracing-tracy` crate which supports our tracing spans
- Expose via the non-default feature `trace_tracy` for consistency with other `trace*` features
2021-09-16 23:39:22 +00:00

2.1 KiB

Cargo Features

Default Features

feature name description
bevy_audio Audio support. Support for all audio formats depends on this.
bevy_gilrs Adds gamepad support.
bevy_gltf glTF support.
bevy_winit GUI support.
bevy_wgpu Make use of GPU via WebGPU support.
render The render pipeline and all render related plugins.
png PNG picture format support.
hdr HDR support.
mp3 MP3 audio format support.
x11 Make GUI applications use X11 protocol. You could enable wayland feature to override this.

Optional Features

feature name description
bevy_dynamic_plugin Plugin for dynamic loading (using libloading).
dynamic Forces bevy to be dynamically linked, which improves iterative compile times.
trace Enables system tracing (useful in tandem with a feature like trace_chrome).
trace_chrome Enables tracing-chrome as bevy_log output. This allows you to visualize system execution.
trace_tracy Enables Tracy as bevy_log output. This allows Tracy to connect to and capture profiling data as well as visualize system execution in real-time, present statistics about system execution times, and more.
wgpu_trace For tracing wgpu.
dds DDS picture format support.
tga TGA picture format support.
jpeg JPEG picture format support.
bmp BMP picture format support.
flac FLAC audio format support. It's included in bevy_audio feature.
wav WAV audio format support.
vorbis Vorbis audio format support.
wasm_audio WASM audio support. (Currently only works with flac, wav and vorbis. Not with mp3)
serialize Enables serialization of bevy_input types.
wayland Enable this to use Wayland display server protocol other than X11.
subpixel_glyph_atlas Enable this to cache glyphs using subpixel accuracy. This increases texture memory usage as each position requires a separate sprite in the glyph atlas, but provide more accurate character spacing.
bevy_ci_testing Used for running examples in CI.