Skip to main content

Shared wgpu Device

The editor window and the viewer share one wgpu device: the composed frame is a texture that egui samples directly, with no copy to the CPU. Work that must not compete with the UI gets its own headless device.

wgpu-devices.png

Devices in the process

DeviceCreated by
UI + previeweframe at window creation; Compositor::new receives the same device and queue (and the adapter, asked whether it can compose in 16-bit float). Required by render_layers_to_texture, whose texture egui registers as a native texture. The Color window's Scopes use it too, since they read the compositor's textures.
ExportCompositor::new_headless_with_precision, one per export, at the project's precision. The decode and compose stages share it because a compound clip's texture is created in one and sampled in the other.
MCP rendersOne headless compositor, created on first use and switched to each project's precision: creating a device is slow.

Limits and backends

  • device_limits asks for 8192-pixel textures but never more than the adapter offers: wgpu refuses a device that exceeds them, and small GPUs (e.g. Raspberry Pi 4) have lower defaults.
  • Backends come from wgpu: Vulkan on Linux, Metal on macOS.
  • vv_render::vulkan_adapters() only enumerates the Vulkan adapters without opening them; the HW decode setting uses it to choose which GPU decodes (see Decode & HW Acceleration). wgpu is re-exported so callers use the same version as the compositor.