[PR #4064] [MERGED] renderer: try a backend again with non-conformant adapters #5393

Closed
opened 2026-11-03 05:12:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4064
Author: @oscargzss
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: nonconformant-adapter-retry


📝 Commits (1)

  • 8bbfc5c renderer: try a backend again with non-conformant adapters

📊 Changes

1 file changed (+166 additions, -87 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+166 -87)

📄 Description

🤖 Opened by oscargzss's AI agent (pi, deepseek-ai/DeepSeek-V4.1-Flash-1017), not by oscargzss personally.

What and why

Fixes #4059.

wgpu hides every adapter whose driver reports Vulkan conformance version 0 (wgpu_hal::vulkan "Adapter is not Vulkan compliant, hiding adapter") unless InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER is set. Mesa reports 0.0.0.0 for hasvk, the vulkan driver for Ivy Bridge and Haswell, and it works: with the flag the game draws on an Intel HD Graphics 4000.

So on such a GPU, Horizon's Vulkan backend reports "found no adapters" although vulkaninfo lists the adapter and it renders, and the only way through was WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER=1 in the player's environment. Before the WindowDisplay fix that also meant no fallback and the message "No Vulkan or OpenGL graphics driver found"; today it silently drops to crocus OpenGL 4.2 on Gen7 Intel.

open_device now asks a backend that offered no adapter at all a second time with those adapters shown, and logs which adapter it took:

Horizon renderer: Vulkan has no conformant adapter (Vulkan: No suitable graphics adapter found; ...); asking again for the ones wgpu hides as non-conformant
Horizon renderer: Intel(R) HD Graphics 4000 (IVB GT2) (Vulkan, IntegratedGpu)
Horizon renderer: using Intel(R) HD Graphics 4000 (IVB GT2) although its driver reports no Vulkan conformance version

A backend that already gives an adapter is untouched: the second try happens only after request_adapter failed with no adapter (a surface, layer or device failure stops there, as before). open_backend is the old loop body, unchanged apart from returning why it stopped; a test asserts the flag is asked for on the second try.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

None: this is the renderer's start-up on the player's machine, not game logic.

Self-check

**pr_ready** (`tools/pr_ready.py --base upstream/main` on kazly-desktop, against upstream/main at bd665f28a, 4 min 16 s)

| Check | Result |
| --- | --- |
| Scope | ✅ 1 files, +166 −87 |
| Cargo.lock | ✅ unchanged |
| Public tree | ✅ |
| Python tests | ✅ 475 passed (54 s) |
| rustfmt | ✅ (10 s) |
| clippy | ✅ (2 min 44 s) |
| tests: horizon-client-render | ❌ 561 passed, 1 failed (9 s) |
| doc tests | ✅ 0 passed (19 s) |
| content root tests | ➖ content root untouched |
| tokens.css up to date | ➖ theme untouched |
| launcher rustfmt | ➖ launcher untouched |
| launcher clippy | ➖ launcher untouched |
| launcher tests | ➖ launcher untouched |
| Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses |

The one failing test is gfx::native_post::tests::passes_chain_through_half_float_targets_with_options_and_depth, WGSL textureLoad from depth textures is not supported in GLSL, and it fails the same way on upstream/main with this branch's gfx.rs checked out unchanged (0 passed, 1 failed): this machine has no GPU driver of its own, so the test's own device comes from a software GL backend. Nothing in this change touches how tests open their device.

Verified on the machine the issue reports (i3-3110M, HD Graphics 4000, Mesa 26.2.5, Arch, KDE Wayland), built with cargo build --profile release -p horizon-client from this branch: --frames 5 --test-terrain with no environment variables reaches pipelines ready on the hasvk Vulkan adapter, and the village benchmark at render distance 8 (960x540) gives 122-126 avg FPS against 16-31 for the OpenGL fallback it used before (that machine had a browser open, so read the direction, not the absolute numbers).

Screenshots

Not a picture: the log lines above are the before and after, on the machine in #4059.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4064 **Author:** [@oscargzss](https://github.com/oscargzss) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `nonconformant-adapter-retry` --- ### 📝 Commits (1) - [`8bbfc5c`](https://github.com/horizon-rust/horizon/commit/8bbfc5cbf06e18f56b3a44c2de0890ccbb3978b8) renderer: try a backend again with non-conformant adapters ### 📊 Changes **1 file changed** (+166 additions, -87 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+166 -87) </details> ### 📄 Description > 🤖 Opened by oscargzss's AI agent (pi, deepseek-ai/DeepSeek-V4.1-Flash-1017), not by oscargzss personally. ## What and why Fixes #4059. wgpu hides every adapter whose driver reports Vulkan conformance version 0 (`wgpu_hal::vulkan` "Adapter is not Vulkan compliant, hiding adapter") unless `InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER` is set. Mesa reports `0.0.0.0` for hasvk, the vulkan driver for Ivy Bridge and Haswell, and it works: with the flag the game draws on an Intel HD Graphics 4000. So on such a GPU, Horizon's Vulkan backend reports "found no adapters" although `vulkaninfo` lists the adapter and it renders, and the only way through was `WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER=1` in the player's environment. Before the `WindowDisplay` fix that also meant no fallback and the message "No Vulkan or OpenGL graphics driver found"; today it silently drops to crocus OpenGL 4.2 on Gen7 Intel. `open_device` now asks a backend that offered no adapter at all a second time with those adapters shown, and logs which adapter it took: ``` Horizon renderer: Vulkan has no conformant adapter (Vulkan: No suitable graphics adapter found; ...); asking again for the ones wgpu hides as non-conformant Horizon renderer: Intel(R) HD Graphics 4000 (IVB GT2) (Vulkan, IntegratedGpu) Horizon renderer: using Intel(R) HD Graphics 4000 (IVB GT2) although its driver reports no Vulkan conformance version ``` A backend that already gives an adapter is untouched: the second try happens only after `request_adapter` failed with no adapter (a surface, layer or device failure stops there, as before). `open_backend` is the old loop body, unchanged apart from returning why it stopped; a test asserts the flag is asked for on the second try. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference None: this is the renderer's start-up on the player's machine, not game logic. ## Self-check ``` **pr_ready** (`tools/pr_ready.py --base upstream/main` on kazly-desktop, against upstream/main at bd665f28a, 4 min 16 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +166 −87 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 475 passed (54 s) | | rustfmt | ✅ (10 s) | | clippy | ✅ (2 min 44 s) | | tests: horizon-client-render | ❌ 561 passed, 1 failed (9 s) | | doc tests | ✅ 0 passed (19 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | ``` The one failing test is `gfx::native_post::tests::passes_chain_through_half_float_targets_with_options_and_depth`, `WGSL textureLoad from depth textures is not supported in GLSL`, and it fails the same way on `upstream/main` with this branch's `gfx.rs` checked out unchanged (0 passed, 1 failed): this machine has no GPU driver of its own, so the test's own device comes from a software GL backend. Nothing in this change touches how tests open their device. Verified on the machine the issue reports (i3-3110M, HD Graphics 4000, Mesa 26.2.5, Arch, KDE Wayland), built with `cargo build --profile release -p horizon-client` from this branch: `--frames 5 --test-terrain` with **no** environment variables reaches `pipelines ready` on the hasvk Vulkan adapter, and the village benchmark at render distance 8 (960x540) gives 122-126 avg FPS against 16-31 for the OpenGL fallback it used before (that machine had a browser open, so read the direction, not the absolute numbers). ## Screenshots Not a picture: the log lines above are the before and after, on the machine in #4059. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:17 +07:00
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5393
No description provided.