Skip to content

feat(compositor): fall back to a WARP device when D3D11 hardware init fails#162

Draft
EtienneLescot wants to merge 2 commits into
release/1.8.0from
feat/d3d-warp-fallback
Draft

feat(compositor): fall back to a WARP device when D3D11 hardware init fails#162
EtienneLescot wants to merge 2 commits into
release/1.8.0from
feat/d3d-warp-fallback

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Scoping PR — no implementation yet. The branch carries a single empty commit so the PR can exist; drop it when the real work starts.

The problem

Both D3D11 devices are created hardware-only, with no fallback:

  • poc-d3d/src/d3d.rs:43D3D11CreateDevice(..., D3D_DRIVER_TYPE_HARDWARE, ...), then bail! if the returned feature level is not 11_1.
  • electron/native/wgc-capture/src/wgc_session.cpp:79 — same driver type.

So on a VM, over RDP, on a machine whose GPU does not reach feature level 11_1, or after a driver fault, the compositor does not start. It fails; it does not degrade.

This matters more than it used to: refactor(preview): remove the CPU and web fallbacks — one native path deliberately removed the preview's software route. There is now nothing behind the native path.

Scope

  • Retry device creation with D3D_DRIVER_TYPE_WARP when the hardware attempt fails.
  • Decide, explicitly, which surfaces accept a WARP device — preview, export, or both. WARP is a CPU rasteriser, so the frame rate will drop hard; shipping it silently for export may be worse than failing.
  • Surface the degraded mode to the user rather than letting it read as "the app is slow today".

Open questions to settle in review

  • Is WARP acceptable for export, or preview only?
  • Does the WGC capture session need the same treatment, or is hardware capture a hard requirement anyway?
  • What does the shader path cost under WARP — is it usable at all, or is a clear error the better product?

Depends on

Nothing blocking, but it shares a reflex with the encoder-selection PR: detect what the host actually offers, then degrade deliberately. Landing that one first would set the pattern.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4fa6f19d-db1c-4c77-91b8-91612543d89f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/d3d-warp-fallback

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant