Skip to main content

Module platform

Module platform 

Source
Expand description

Platform window bridging for baseview / wgpu.

WgpuBackend::from_window consumes a baseview::Window; that window exposes raw-window-handle 0.5 handles but wgpu wants 0.6, so the bridge re-encodes per platform here. Lives in truce-gpu so the wgpu pipeline crate is self-contained; the per-OS HWND/NSView lookups + DPI queries live next door in truce_gui::platform.

Functions§

create_wgpu_surface
Bridge a baseview raw-window-handle 0.5 to a wgpu-compatible SurfaceTargetUnsafe using rwh 0.6 types.
editor_instance_descriptor
wgpu::InstanceDescriptor for editor surfaces, pinning the DX12 shader compiler to FXC. Mirror of truce_gui::platform::editor_instance_descriptor - see it for why the wgpu-29 DX12 default (dynamic DXC) breaks inside Pro Tools. Keep the two copies in sync.
editor_wgpu_backends
wgpu backends for an editor surface embedded in a host-owned child window. Mirror of truce_gui::platform::editor_wgpu_backends (truce-gpu can’t depend on truce-gui without a dep cycle). Windows is DX12 (the only backend feature compiled in on Windows), macOS is Metal, Linux keeps PRIMARY. Keep the two copies in sync.