Skip to content

M3a: resolve the D3D12 open-command-list ADAPT (fallback first, optional wgpu-hal raw_list() PR) #2

Description

@Bantarus

Context

The one real adaptation the D3D12 spike found: the M2a non-blocking trick hands rive wgpu's OWN open command buffer. On Vulkan that works because wgpu-hal vulkan CommandEncoder exposes pub unsafe fn raw_handle(). The wgpu-hal dx12 CommandEncoder holds the open list in a PRIVATE list: Option<ID3D12GraphicsCommandList> (dx12/mod.rs:861) with no accessor — so as_hal_mut::<dx12::Api>() cannot read it.

Scope

  • Default path (ship this): fallback (b) — rive records into its OWN ID3D12GraphicsCommandList; the bridge does one extra same-queue ExecuteCommandLists via Queue::as_raw() (dx12/mod.rs:739). A single D3D12 queue executes in submission order, so it stays correct and non-blocking (recycle via the watermark). The shim's create signature already takes a CommandQueue (not a per-frame buffer), encoding this model.
  • Optional follow-up: add pub unsafe fn raw_list(&self) -> &ID3D12GraphicsCommandList to wgpu-hal's dx12 CommandEncoder (mirror vulkan's raw_handle()), vendor-patch + upstream PR, enabling the 1:1 record-into-wgpu's-list version (saves one submit/frame).

Acceptance criteria

  • D3D12 zero-copy frames are non-blocking with NO wgpu-hal patch (fallback path), correctness verified.
  • If the raw_list() patch is pursued: gated behind a cfg/feature so the default build needs no patch; PR link recorded.

Refs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions