Cargo Features

wgpu-core has no features set by default.

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

Internally count resources and events for debugging purposes. If the counters feature is disabled, the counting infrastructure is removed from the build and the exposed counters always return 0.

Enables counters of wgpu-types

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.

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

indirect-validation

Validates indirect draw/dispatch calls. This will also enable naga's WGSL frontend since we use a WGSL compute shader to do the validation.

Enables wgsl-in of naga

serde observe_locks? replay? trace?

Enables serialization via serde on common wgpu types.

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

trace = serde

Enable API tracing.

Enables ron, serialize of naga

Affects trace::Trace, device::trace

observe_locks

Enable lock order observation.

Enables ron, serde_derive of serde

replay = serde

Enable API replaying

Enables deserialize of naga

Affects device::trace

raw-window-handle

Enable creating instances using raw-window-handle

Enables raw-window-handle

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