Skip to content

Commit b71ba57

Browse files
committed
[update] feature format and document audio flags.
1 parent 939c07c commit b71ba57

1 file changed

Lines changed: 64 additions & 16 deletions

File tree

docs/features.md

Lines changed: 64 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,69 @@ title: "Cargo Features Overview"
33
document_id: "features-2025-11-17"
44
status: "living"
55
created: "2025-11-17T23:59:00Z"
6-
last_updated: "2026-01-25T00:00:00Z"
7-
version: "0.1.6"
6+
last_updated: "2026-01-30T22:10:39Z"
7+
version: "0.1.7"
88
engine_workspace_version: "2023.1.30"
99
wgpu_version: "26.0.1"
1010
shader_backend_default: "naga"
1111
winit_version: "0.29.10"
12-
repo_commit: "229960fd426cf605c7513002b36e3942f14a3140"
12+
repo_commit: "939c07cf5c7ff583559c60ea7bb571961579f12b"
1313
owners: ["lambda-sh"]
1414
reviewers: ["engine", "rendering"]
15-
tags: ["guide", "features", "validation", "cargo"]
15+
tags: ["guide", "features", "validation", "cargo", "audio"]
1616
---
1717

1818
## Overview
19-
This document enumerates the primary Cargo features exposed by the workspace relevant to rendering and validation behavior. It defines defaults, relationships, and expected behavior in debug and release builds.
19+
This document enumerates the primary Cargo features exposed by the workspace
20+
relevant to rendering, validation, and audio behavior. It defines defaults,
21+
relationships, and expected behavior in debug and release builds.
2022

2123
## Table of Contents
2224
- [Overview](#overview)
2325
- [Defaults](#defaults)
24-
- [Rendering Backends](#rendering-backends)
25-
- [Shader Backends](#shader-backends)
26-
- [Render Validation](#render-validation)
26+
- [`lambda-rs`](#lambda-rs)
27+
- [`lambda-rs-platform`](#lambda-rs-platform)
2728
- [Changelog](#changelog)
2829

2930
## Defaults
3031
- Workspace defaults prefer `wgpu` on supported platforms and `naga` for shader compilation.
3132
- Debug builds enable all validations unconditionally via `debug_assertions`.
3233
- Release builds enable only cheap safety checks by default; validation logs and per-draw checks MUST be enabled explicitly via features.
34+
- Audio features are disabled by default and incur runtime cost only when an
35+
audio device is initialized and kept alive.
3336

34-
## Rendering Backends
35-
- `lambda-rs`
36-
- `with-wgpu` (default): enables the `wgpu` platform backend via `lambda-rs-platform`.
37-
- Platform specializations: `with-wgpu-vulkan`, `with-wgpu-metal`, `with-wgpu-dx12`, `with-wgpu-gl`.
37+
## `lambda-rs`
3838

39-
## Shader Backends
40-
- `lambda-rs-platform`
41-
- `shader-backend-naga` (default): uses `naga` for shader handling.
39+
Rendering backends
40+
- `with-wgpu` (default): enables the `wgpu` platform backend via
41+
`lambda-rs-platform/wgpu`.
42+
- Platform specializations:
43+
- `with-wgpu-vulkan`: enables the Vulkan backend via
44+
`lambda-rs-platform/wgpu-with-vulkan`.
45+
- `with-wgpu-metal`: enables the Metal backend via
46+
`lambda-rs-platform/wgpu-with-metal`.
47+
- `with-wgpu-dx12`: enables the DirectX 12 backend via
48+
`lambda-rs-platform/wgpu-with-dx12`.
49+
- `with-wgpu-gl`: enables the OpenGL/WebGL backend via
50+
`lambda-rs-platform/wgpu-with-gl`.
51+
- Convenience aliases:
52+
- `with-vulkan`: alias for `with-wgpu` and `with-wgpu-vulkan`.
53+
- `with-metal`: alias for `with-wgpu` and `with-wgpu-metal`.
54+
- `with-dx12`: alias for `with-wgpu` and `with-wgpu-dx12`.
55+
- `with-opengl`: alias for `with-wgpu` and `with-wgpu-gl`.
56+
- `with-dx11`: alias for `with-wgpu`.
4257

43-
## Render Validation
58+
Audio
59+
- `audio` (umbrella, disabled by default): enables audio support by composing
60+
granular audio features. This umbrella includes `audio-output-device`.
61+
- `audio-output-device` (granular, disabled by default): enables audio output
62+
device enumeration and callback-based audio output via `lambda::audio`. This
63+
feature enables `lambda-rs-platform/audio-device` internally. Expected
64+
runtime cost is proportional to the output callback workload and buffer size;
65+
no runtime cost is incurred unless an `AudioOutputDevice` is built and kept
66+
alive.
67+
68+
Render validation
4469

4570
Umbrella features (crate: `lambda-rs`)
4671
- `render-validation`: enables common builder/pipeline validation logs (MSAA counts, depth clear advisories, stencil format upgrades, render-target compatibility) by composing granular validation features. This umbrella includes `render-validation-msaa`, `render-validation-depth`, `render-validation-stencil`, `render-validation-pass-compat`, and `render-validation-render-targets`.
@@ -84,7 +109,30 @@ Usage examples
84109
- Enable only MSAA validation in release:
85110
- `cargo test -p lambda-rs --features render-validation-msaa`
86111

112+
## `lambda-rs-platform`
113+
114+
This crate provides platform and dependency abstractions for `lambda-rs`.
115+
Applications MUST NOT depend on `lambda-rs-platform` directly.
116+
117+
Rendering backend
118+
- `wgpu` (default): enables the `wgpu` backend.
119+
- `wgpu-with-vulkan`: enables Vulkan support.
120+
- `wgpu-with-metal`: enables Metal support.
121+
- `wgpu-with-dx12`: enables DirectX 12 support.
122+
- `wgpu-with-gl`: enables OpenGL/WebGL support.
123+
124+
Shader backends
125+
- `shader-backend-naga` (default): uses `naga` for shader handling.
126+
127+
Audio
128+
- `audio` (umbrella, disabled by default): enables platform audio support by
129+
composing granular platform audio features. This umbrella includes
130+
`audio-device`.
131+
- `audio-device` (granular, disabled by default): enables the internal audio
132+
backend module `lambda_platform::cpal` backed by `cpal =0.17.1`.
133+
87134
## Changelog
135+
- 0.1.7 (2026-01-30): Group features by crate and document audio feature flags.
88136
- 0.1.6 (2026-01-25): Remove the deprecated legacy shader backend
89137
documentation.
90138
- 0.1.5 (2025-12-22): Align `lambda-rs` Cargo feature umbrella composition with

0 commit comments

Comments
 (0)