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

Inline document-features usage, remove dep. #4924

Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 0 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ cfg_aliases = "0.1"
cfg-if = "1"
codespan-reporting = "0.11"
ctor = "0.2"
document-features = "0.2"
encase = "0.6"
env_logger = "0.10"
fern = "0.6"
Expand Down
1 change: 0 additions & 1 deletion wgpu-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ arrayvec = "0.7"
bit-vec = "0.6"
bitflags = "2"
codespan-reporting = "0.11"
document-features.workspace = true
log = "0.4"
# parking_lot 0.12 switches from `winapi` to `windows`; permit either
parking_lot = ">=0.11,<0.13"
Expand Down
30 changes: 29 additions & 1 deletion wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,36 @@
//! into other language-specific user-friendly libraries.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
// NOTE: feature docs. below should be kept in sync. with `Cargo.toml`!
//!
//! - **`api_log_info`** --- Log all API entry points at info instead of trace level.
//! - **`resource_log_info`** --- Log resource lifecycle management at info instead of trace level.
//! - **`link`** _(enabled by default)_ --- Use static linking for libraries. Disale to manually
//! link. Enabled by default.
//! - **`renderdoc`** --- Support the Renderdoc graphics debugger:
//! [https://renderdoc.org/](https://renderdoc.org/)
//! - **`strict_asserts`** --- Apply run-time checks, even in release builds. These are in addition
//! to the validation carried out at public APIs in all builds.
//! - **`trace`** --- Enable API tracing.
//! - **`replay`** --- Enable API replaying
//! - **`serial-pass`** --- Enable serializable compute/render passes, and bundle encoders.
//! - **`wgsl`** --- Enable `ShaderModuleSource::Wgsl`
//! - **`fragile-send-sync-non-atomic-wasm`** --- Implement `Send` and `Sync` on Wasm, but only if
//! atomics are not enabled.
//!
//! WebGL/WebGPU objects can not be shared between threads. However, it can be useful to
//! artificially mark them as `Send` and `Sync` anyways to make it easier to write cross-platform
//! code. This is technically _very_ unsafe in a multithreaded environment, but on a wasm binary
//! compiled without atomics we know we are definitely not in a multithreaded environment.
//!
//! ### Backends, passed through to wgpu-hal
//!
//! - **`metal`** --- Enable the `metal` backend.
//! - **`vulkan`** --- Enable the `vulkan` backend.
//! - **`gles`** --- Enable the `GLES` backend.
//!
//! This is used for all of GLES, OpenGL, and WebGL.
//! - **`dx12`** --- Enable the `dx12` backend.

// When we have no backends, we end up with a lot of dead or otherwise unreachable code.
#![cfg_attr(
Expand Down
1 change: 0 additions & 1 deletion wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ optional = true
[dependencies]
arrayvec.workspace = true
cfg-if.workspace = true
document-features.workspace = true
log.workspace = true
parking_lot.workspace = true
profiling.workspace = true
Expand Down
47 changes: 46 additions & 1 deletion wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,52 @@
//! To start using the API, create an [`Instance`].
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
// NOTE: feature docs. below should be kept in sync. with `Cargo.toml`!
//!
//! ### Backends
//!
//! ⚠️ WIP: Not all backends can be manually configured today. On Windows & Linux the Vulkan & GLES
//! backends are always enabled. See [#3514](https://github.com/gfx-rs/wgpu/issues/3514) for more
//! details.
//!
//! - **`dx12`** _(enabled by default)_ --- Enables the DX12 backend on Windows.
//! - **`metal`** _(enabled by default)_ --- Enables the Metal backend on macOS & iOS.
//! - **`angle`** --- Enables the GLES backend via [ANGLE](https://github.com/google/angle) on macOS
//! using.
//! - **`vulkan-portability`** --- Enables the Vulkan backend on macOS & iOS.
//! - **`webgl`** --- Enables the GLES backend on Wasm
//!
//! - ⚠️ WIP: Currently will also enable GLES dependencies on any other targets.
//! - ⚠️ WIP: This automatically disables use of WebGPU. See
//! [#2804](https://github.com/gfx-rs/wgpu/issues/3514).
//!
//! ### Shading language support
//!
//! - **`spirv`** --- Enable accepting SPIR-V shaders as input.
//! - **`glsl`** --- Enable accepting GLSL shaders as input.
//! - **`wgsl`** _(enabled by default)_ --- Enable accepting WGSL shaders as input.
//!
//! ### Logging & Tracing
//!
//! The following features do not have any effect on the WebGPU backend.
//!
//! - **`strict_asserts`** --- Apply run-time checks, even in release builds. These are in addition
//! to the validation carried out at public APIs in all builds.
//! - **`api_log_info`** --- Log all API entry points at info instead of trace level.
//! - **`trace`** --- Allow writing of trace capture files. See [`Adapter::request_device`].
//! - **`replay`** --- Allow deserializing of trace capture files that were written with the `trace`
//! feature. To replay a trace file use the [wgpu
//! player](https://github.com/gfx-rs/wgpu/tree/trunk/player).
//!
//! ### Other
//!
//! - **`fragile-send-sync-non-atomic-wasm`** --- Implement `Send` and `Sync` on Wasm, but only if
//! atomics are not enabled.
//!
//! WebGL/WebGPU objects can not be shared between threads. However, it can be useful to
//! artificially mark them as `Send` and `Sync` anyways to make it easier to write cross-platform
//! code. This is technically _very_ unsafe in a multithreaded environment, but on a wasm binary
//! compiled without atomics we know we are definitely not in a multithreaded environment.
//!

#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
Expand Down
Loading