Cargo Features

wgpu-hal has no features set by default.

[dependencies]
wgpu-hal = { version = "23.0.0", features = ["metal", "vulkan", "gles", "dx12", "renderdoc", "fragile-send-sync-non-atomic-wasm", "oom_panic", "device_lost_panic", "internal_error_panic"] }
metal

Enables the Metal backend when targeting Apple platforms.

Has no effect on non-Apple platforms.

Enables block, msl-out-if-target-apple of naga

vulkan

Enables smallvec, android_system_properties, ash, gpu-alloc, gpu-descriptor, and libloading, spv-out of naga

gles

Enables ndk-sys ^0.5.0, glsl-out of naga, Win32_Graphics_Gdi, Win32_Graphics_OpenGL, Win32_System_LibraryLoader and Win32_UI_WindowsAndMessaging of windows and bytemuck, glow ^0.14.2, glutin_wgl_sys, khronos-egl, and libloading

bytemuck:

backend: Gles

dx12

Enables the DX12 backend when targeting Windows.

Has no effect if not targeting Windows.

Enables bit-set, libloading, range-alloc, windows-core, d3d12 of gpu-allocator, hlsl-out-if-target-windows of naga, Win32_Graphics_Direct3D, Win32_Graphics_Direct3D12, Win32_Graphics_Direct3D_Dxc, Win32_Graphics_Direct3D_Fxc, Win32_Graphics_DirectComposition, Win32_Graphics_Dxgi_Common, Win32_Security, Win32_System_Diagnostics_Debug, Win32_System_Kernel, Win32_System_Performance, Win32_System_Threading and Win32_UI_WindowsAndMessaging of windows

renderdoc

Enables libloading and renderdoc-sys

fragile-send-sync-non-atomic-wasm

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

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.

gpu-allocator win dx12?
windows win dx12? gles?