Cargo Features

[dependencies]
wgpu-hal = { version = "0.20.0", default-features = false, features = ["metal", "vulkan", "gles", "dx12", "windows_rs", "dxc_shader_compiler", "renderdoc", "fragile-send-sync-non-atomic-wasm", "link", "oom_panic", "device_lost_panic", "internal_error_panic"] }
default = link

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

metal link = block

Enables msl-out of naga

vulkan = android_system_properties, ash, gpu-alloc, gpu-descriptor, libloading, smallvec

Enables spv-out of naga

gles = glow, glutin_wgl_sys, khronos-egl, libloading, ndk-sys

Enables glsl-out of naga

dx12 = bit-set, d3d12, libloading, range-alloc

Enables hlsl-out of naga, d3d12, d3d12sdklayers, d3d12shader, dxgi1_6, std and winbase of winapi

windows_rs = gpu-allocator

TODO: This is a separate feature until Mozilla okays windows-rs, see https://github.com/gfx-rs/wgpu/issues/3207 for the tracking issue.

dxc_shader_compiler = hassle-rs
renderdoc = libloading, renderdoc-sys
fragile-send-sync-non-atomic-wasm

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

Enables link of metal

oom_panic

Panic when running into an out-of-memory error (for debugging purposes).

Only affects the d3d12 and vulkan backends.

device_lost_panic

Panic when running into a device lost error (for debugging purposes).
Only affects the d3d12 and vulkan backends.

internal_error_panic

Panic when running into an internal error other than out-of-memory and device lost (for debugging purposes).

Only affects the d3d12 and vulkan backends.

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.

glow gles?

Enables glow

backend: Gles

android_system_properties android vulkan?
ash not wasm32 vulkan?

Enables ash ^0.37.3

bit-set win dx12?
block mac ios metal?
d3d12 win dx12?
glutin_wgl_sys win gles?
gpu-alloc not wasm32 vulkan?
gpu-allocator win windows_rs?

Enables gpu-allocator ^0.25

gpu-descriptor not wasm32 vulkan?
hassle-rs win dxc_shader_compiler?
khronos-egl not wasm32 emscripten gles?
ndk-sys android gles?

Enables ndk-sys ^0.5.0

range-alloc win dx12?
renderdoc-sys not wasm32 renderdoc?
smallvec not wasm32 vulkan?
libloading not wasm32 emscripten dx12? gles? renderdoc? vulkan?