Cargo Features

[dependencies]
wgpu-hal = { version = "0.19.4", default-features = false, features = ["metal", "vulkan", "gles", "dx12", "windows_rs", "dxc_shader_compiler", "renderdoc", "fragile-send-sync-non-atomic-wasm", "link"] }
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 = ash, gpu-alloc, gpu-descriptor, libloading, smallvec

Enables spv-out of naga

gles = glow, glutin_wgl_sys, khronos-egl, libloading

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

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

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?
gpu-descriptor not wasm32 vulkan?

Enables gpu-descriptor ^0.2

hassle-rs win dxc_shader_compiler?
khronos-egl not wasm32 emscripten gles?
range-alloc win dx12?
renderdoc-sys not wasm32 renderdoc?
smallvec not wasm32 vulkan?
libloading emscripten not wasm32 dx12? gles? renderdoc? vulkan?