fix: the launcher draws its window with Direct3D 12 on Windows #522

Merged
Luke-Ervin merged 1 commit from upstream-pr/522 into main 2026-11-27 19:38:44 +00:00
Luke-Ervin commented 2026-11-27 15:57:17 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by Luke-Ervin on 2026-11-27T15:57:17Z.


Change

On Windows, the launcher now draws its own window with Direct3D 12 alone, instead of letting wgpu try Vulkan and Direct3D 12.

In #483 the launcher never opened its window on one Windows 11 machine (Home, Insider Preview 26H2, build 26340), from the release download or a local build: the process stayed in memory at about 1 MB until it was killed, with no Smart App Control block and no quarantine. Started after set WGPU_BACKEND=dx12, it opened normally (the reporter's answer: dx12).

  • New crates/anyxboxx-launcher/src/renderer.rs: window_backends() takes the backends WGPU_BACKEND names when it is set; else Direct3D 12 alone on Windows; else, under Proton and Wine, egui-wgpu's own default. wgpu_options() puts that into eframe's WgpuConfiguration.
  • main.rs passes wgpu_options(host::detect_host()) in NativeOptions, using the launcher's existing host detection (Wine's wine_get_version export).
  • docs/launcher.md and docs/fr/lanceur.md: a troubleshooting line for a launcher that never opens its window, with the WGPU_BACKEND setting.

Why Direct3D 12, and only on real Windows:

  • The game needs Direct3D 12 (the guide requires a Direct3D 12 GPU, and the Setup page checks d3d12.dll), so every machine that runs the game has it. Vulkan is then never loaded for the window: no Vulkan instance, no implicit layers.
  • WGPU_BACKEND still wins, so Vulkan stays one setting away.
  • Under Proton and Wine, Direct3D 12 is itself a translation onto Vulkan (vkd3d) and the hang was not seen, so the default is left alone there.

What it changes for other Windows users: with both backends allowed, wgpu lists Vulkan adapters before Direct3D 12 ones (wgpu-core 29: Instance::new adds Vulkan, then Metal, then Dx12, and request_adapter sorts only by device type, stably), so on a machine with a Vulkan driver the window has been drawn through Vulkan until now. It is drawn through Direct3D 12 from now on: the API the game itself uses on that machine.

Not known: why the hang happens (an implicit Vulkan layer from another program, or a driver on a preview build, are the usual suspects). Only one machine has shown it.

Linked issue: Refs #483

Verification

Linux, Rust 1.98.1, GNU Windows target (x86_64-pc-windows-gnu, MinGW), on top of main at 173bee0:

cargo check -p anyxboxx-launcher --target x86_64-pc-windows-gnu --all-targets → no errors, no warnings
cargo clippy -p anyxboxx-launcher --target x86_64-pc-windows-gnu --all-targets -- -D warnings → no warnings
rustfmt --edition 2024 --check crates/anyxboxx-launcher/src/renderer.rs → clean
python -m pytest → 1494 passed, 465 skipped
python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools → All checks passed!

Not run: the launcher's tests (Wine aborts at start-up in that container) and the launcher itself on Windows. The Windows cargo test job of CI runs the tests. cargo fmt --check -p anyxboxx-launcher reports diffs in env.rs, launch.rs and options.rs that are already on main; this pull request leaves those files untouched.

Oracle and test data

  • Oracle: the reporter's result in #483 (the window opens with WGPU_BACKEND=dx12), and egui-wgpu 0.34's default (Backends::from_env().unwrap_or(Backends::PRIMARY | Backends::GL)), read in its source.
  • Test data: none; the tests are pure.
  • Tests: renderer::tests check the choice on each host, that WGPU_BACKEND wins on both, and that the options still let eframe create its own wgpu instance (otherwise the backends would be ignored). They fail to compile without the module.

Checklist

  • The PR covers a single reviewable behaviour.
  • A test fails without this change and passes with it. (Not shown: the new tests could not be run here, see Verification; the Windows CI job runs them.)
  • The commands and results of each check are given above.
  • An unimplemented function returns an error (E_NOTIMPL), never a fake success.
  • README: the same change in the English and French READMEs (test_readme_sync.py checks it). No README change; the launcher guide is changed in both languages.
  • No game, console or SDK file, no key, no dump, no download link.
  • Findings drawn from a title: none in this PR.
  • Code taken from another project: none in this PR.

This change was made with AI assistance (Claude Code): written and statically checked by the AI as described above. It was not run on Windows.

🤖 Generated with Claude Code

<!-- greyfinch-sync:LooperSalty/AnyXboxX:issue:5529516861 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/522). Originally posted by [Luke-Ervin](https://github.com/Luke-Ervin) on 2026-11-27T15:57:17Z. --- ## Change On Windows, the launcher now draws its own window with Direct3D 12 alone, instead of letting wgpu try Vulkan and Direct3D 12. In #483 the launcher never opened its window on one Windows 11 machine (Home, Insider Preview 26H2, build 26340), from the release download or a local build: the process stayed in memory at about 1 MB until it was killed, with no Smart App Control block and no quarantine. Started after `set WGPU_BACKEND=dx12`, it opened normally (the reporter's answer: `dx12`). - New `crates/anyxboxx-launcher/src/renderer.rs`: `window_backends()` takes the backends `WGPU_BACKEND` names when it is set; else Direct3D 12 alone on Windows; else, under Proton and Wine, egui-wgpu's own default. `wgpu_options()` puts that into eframe's `WgpuConfiguration`. - `main.rs` passes `wgpu_options(host::detect_host())` in `NativeOptions`, using the launcher's existing host detection (Wine's `wine_get_version` export). - `docs/launcher.md` and `docs/fr/lanceur.md`: a troubleshooting line for a launcher that never opens its window, with the `WGPU_BACKEND` setting. Why Direct3D 12, and only on real Windows: - The game needs Direct3D 12 (the guide requires a Direct3D 12 GPU, and the Setup page checks `d3d12.dll`), so every machine that runs the game has it. Vulkan is then never loaded for the window: no Vulkan instance, no implicit layers. - `WGPU_BACKEND` still wins, so Vulkan stays one setting away. - Under Proton and Wine, Direct3D 12 is itself a translation onto Vulkan (vkd3d) and the hang was not seen, so the default is left alone there. What it changes for other Windows users: with both backends allowed, wgpu lists Vulkan adapters before Direct3D 12 ones (wgpu-core 29: `Instance::new` adds Vulkan, then Metal, then Dx12, and `request_adapter` sorts only by device type, stably), so on a machine with a Vulkan driver the window has been drawn through Vulkan until now. It is drawn through Direct3D 12 from now on: the API the game itself uses on that machine. Not known: why the hang happens (an implicit Vulkan layer from another program, or a driver on a preview build, are the usual suspects). Only one machine has shown it. Linked issue: Refs #483 ## Verification Linux, Rust 1.98.1, GNU Windows target (`x86_64-pc-windows-gnu`, MinGW), on top of `main` at `173bee0`: ``` cargo check -p anyxboxx-launcher --target x86_64-pc-windows-gnu --all-targets → no errors, no warnings cargo clippy -p anyxboxx-launcher --target x86_64-pc-windows-gnu --all-targets -- -D warnings → no warnings rustfmt --edition 2024 --check crates/anyxboxx-launcher/src/renderer.rs → clean python -m pytest → 1494 passed, 465 skipped python -m ruff check --select W605,F,E9 PrototypeScarlett tests tools → All checks passed! ``` Not run: the launcher's tests (Wine aborts at start-up in that container) and the launcher itself on Windows. The Windows `cargo test` job of CI runs the tests. `cargo fmt --check -p anyxboxx-launcher` reports diffs in `env.rs`, `launch.rs` and `options.rs` that are already on `main`; this pull request leaves those files untouched. ## Oracle and test data - Oracle: the reporter's result in #483 (the window opens with `WGPU_BACKEND=dx12`), and egui-wgpu 0.34's default (`Backends::from_env().unwrap_or(Backends::PRIMARY | Backends::GL)`), read in its source. - Test data: none; the tests are pure. - Tests: `renderer::tests` check the choice on each host, that `WGPU_BACKEND` wins on both, and that the options still let eframe create its own wgpu instance (otherwise the backends would be ignored). They fail to compile without the module. ## Checklist - [x] The PR covers a single reviewable behaviour. - [x] A test fails without this change and passes with it. (Not shown: the new tests could not be run here, see Verification; the Windows CI job runs them.) - [x] The commands and results of each check are given above. - [x] An unimplemented function returns an error (`E_NOTIMPL`), never a fake success. - [x] README: the same change in the English and French READMEs (`test_readme_sync.py` checks it). No README change; the launcher guide is changed in both languages. - [x] No game, console or SDK file, no key, no dump, no download link. - [x] Findings drawn from a title: none in this PR. - [x] Code taken from another project: none in this PR. This change was made with AI assistance (Claude Code): written and statically checked by the AI as described above. It was not run on Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chatgpt-codex-connector[bot] commented 2026-11-27 15:57:26 +00:00 (Migrated from github.com)

Imported from LooperSalty/AnyXboxX. Originally posted by chatgpt-codex-connector[bot] on 2026-11-27T15:57:26Z.


Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T15:59:55.365018Z 1cba944 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

<!-- greyfinch-sync:LooperSalty/AnyXboxX:comment:7222684334 --> Imported from [LooperSalty/AnyXboxX](https://github.com/LooperSalty/AnyXboxX/pull/522#issuecomment-7222684334). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/apps/chatgpt-codex-connector) on 2026-11-27T15:57:26Z. --- <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"1cba9441c57f094c913d48c68d0cbff78b827ba7","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-27T15:59:55.365018Z">2026-11-27T15:59:55.365018Z</relative-time> | `1cba944` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@codex review" or "@codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
LooperSalty/AnyXboxX!522
No description provided.