Cargo Features

[dependencies]
wgpu-core = { version = "0.20.0", default-features = false, features = ["api_log_info", "resource_log_info", "link", "renderdoc", "strict_asserts", "serde", "trace", "replay", "wgsl", "glsl", "spirv", "fragile-send-sync-non-atomic-wasm", "metal", "vulkan", "gles", "dx12", "raw-window-handle"] }
default = link

The link feature is set by default whenever wgpu-core is added without default-features = false somewhere in the dependency tree.

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.

Use static linking for libraries. Disable to manually link. Enabled by default.

Enables link of wgpu-hal

renderdoc

Support the Renderdoc graphics debugger: https://renderdoc.org/

Enables renderdoc of wgpu-hal

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.

Enables strict_asserts of wgpu-types

serde replay? trace?

Enables serialization via serde on common wgpu types.

Enables serde, serde of arrayvec, serde of wgpu-types

trace = ron, serde

Enable API tracing.

Enables serialize of naga

Affects trace::Trace, device::trace

replay = serde

Enable API replaying

Enables deserialize of naga

Affects device::trace

wgsl

Enable ShaderModuleSource::Wgsl

Enables wgsl-in of naga

glsl

Enable ShaderModuleSource::Glsl

Enables glsl-in of naga

spirv

Enable ShaderModuleSource::SpirV

Enables bytemuck, spv-in of naga

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.

Enables fragile-send-sync-non-atomic-wasm of wgpu-hal and wgpu-types

metal

Backends, passed through to wgpu-hal


Enable the metal backend.

Enables metal of wgpu-hal

vulkan

Enable the vulkan backend.

Enables vulkan of wgpu-hal

gles

Enable the GLES backend.

This is used for all of GLES, OpenGL, and WebGL.

Enables gles of wgpu-hal

dx12

Enable the dx12 backend.

Enables dx12 of wgpu-hal

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

raw-window-handle implicit feature

Enables raw-window-handle

raw-window-handle:

Interoperability library for Rust Windowing applications

ron trace?