[PR #1917] [MERGED] OpenGL: Horizon starts on GPUs with no Vulkan or DirectX 12 driver #3863

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1917
Author: @ludovic111
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/opengl-fallback


📝 Commits (3)

  • 03a5cbd Renderer: OpenGL as the last fallback, for GPUs with no Vulkan or DirectX 12 driver
  • 54bb3e4 Screen effects: one sampler per entry point, so the shader compiles for OpenGL
  • 903da4f Cargo.lock: wgpu's GL backend dependencies (glow, khronos-egl, glutin_wgl_sys)

📊 Changes

5 files changed (+166 additions, -52 deletions)

View changed files

📝 Cargo.lock (+83 -0)
📝 crates/horizon-client/Cargo.toml (+5 -0)
📝 crates/horizon-client/src/gfx.rs (+44 -37)
📝 crates/horizon-client/src/graphics.rs (+12 -3)
📝 crates/horizon-client/src/screen.wgsl (+22 -12)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

A player with an AMD Radeon HD 7400M (TeraScale 2: DirectX 11 and OpenGL 4.x, no Vulkan, no DirectX 12 driver) could not start Horizon at all: Failed to create surface for any enabled backend. Ludovic made it the top priority.

What players get

  • Auto now tries Vulkan, then DirectX 12 (Windows), then OpenGL (Windows: WGL, Linux: EGL). Machines where Vulkan or DirectX 12 work are unchanged: OpenGL is only reached when both fail.
  • Options > Graphics > Graphics API has OpenGL; graphicsApi:opengl or HORIZON_GRAPHICS_API=opengl picks it. macOS keeps Metal only.
  • Helps every GPU too old for Vulkan/DirectX 12 (older Radeon HD, Intel HD, GeForce).

Changes

  • wgpu's gles feature on non-macOS targets (+ Cargo.lock: glow, khronos-egl, glutin_wgl_sys).
  • backend_order by OS, a GraphicsApi::OpenGl choice, the no-driver message mentions OpenGL.
  • screen.wgsl: the screen-effect fragment shaders sampled one texture with two samplers in one entry point, which GLSL can't express (naga ImageMultipleSamplers): split into fs_screen / fs_screen_blur / fs_vignette / fs_vignette_blur, one sampler each, gfx.rs picks the entry instead of the BLUR override. Same output on every backend.

Tested

  • Linux, HORIZON_GRAPHICS_API=opengl, Mesa llvmpipe (GL 4.6 core) under Xvfb: title, then in a creative world on the server thread, screenshot rendered (terrain, sky, clouds, hand, hotbar), no error in the log.
  • backend_order unit test for Windows / Linux / macOS / WGPU_BACKEND; shader translation tests (29 pass).
  • wgpu with gles+dx12+vulkan type-checks for x86_64-pc-windows-msvc.
  • Follow-ups (next PR): textures whose layer count makes GL guess the wrong view dimension, and a non-compute path for GL older than 4.3.

🤖 Generated with Claude Code


🔄 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/1917 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/opengl-fallback` --- ### 📝 Commits (3) - [`03a5cbd`](https://github.com/horizon-rust/horizon/commit/03a5cbdcd800bb6d41c3f6ffb88e875ce25e9f07) Renderer: OpenGL as the last fallback, for GPUs with no Vulkan or DirectX 12 driver - [`54bb3e4`](https://github.com/horizon-rust/horizon/commit/54bb3e4fbe869bfc223d0daa2ccf2fa329c721e8) Screen effects: one sampler per entry point, so the shader compiles for OpenGL - [`903da4f`](https://github.com/horizon-rust/horizon/commit/903da4f1ab8f6735a8d60734a63bcecdd4edbe9e) Cargo.lock: wgpu's GL backend dependencies (glow, khronos-egl, glutin_wgl_sys) ### 📊 Changes **5 files changed** (+166 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+83 -0) 📝 `crates/horizon-client/Cargo.toml` (+5 -0) 📝 `crates/horizon-client/src/gfx.rs` (+44 -37) 📝 `crates/horizon-client/src/graphics.rs` (+12 -3) 📝 `crates/horizon-client/src/screen.wgsl` (+22 -12) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. A player with an **AMD Radeon HD 7400M** (TeraScale 2: DirectX 11 and OpenGL 4.x, no Vulkan, no DirectX 12 driver) could not start Horizon at all: `Failed to create surface for any enabled backend`. Ludovic made it the top priority. ## What players get - **Auto** now tries Vulkan, then DirectX 12 (Windows), then **OpenGL** (Windows: WGL, Linux: EGL). Machines where Vulkan or DirectX 12 work are unchanged: OpenGL is only reached when both fail. - Options > Graphics > Graphics API has **OpenGL**; `graphicsApi:opengl` or `HORIZON_GRAPHICS_API=opengl` picks it. macOS keeps Metal only. - Helps every GPU too old for Vulkan/DirectX 12 (older Radeon HD, Intel HD, GeForce). ## Changes - wgpu's `gles` feature on non-macOS targets (+ Cargo.lock: glow, khronos-egl, glutin_wgl_sys). - `backend_order` by OS, a `GraphicsApi::OpenGl` choice, the no-driver message mentions OpenGL. - `screen.wgsl`: the screen-effect fragment shaders sampled one texture with two samplers in one entry point, which GLSL can't express (naga `ImageMultipleSamplers`): split into `fs_screen` / `fs_screen_blur` / `fs_vignette` / `fs_vignette_blur`, one sampler each, gfx.rs picks the entry instead of the `BLUR` override. Same output on every backend. ## Tested - Linux, `HORIZON_GRAPHICS_API=opengl`, Mesa llvmpipe (GL 4.6 core) under Xvfb: title, then in a creative world on the server thread, screenshot rendered (terrain, sky, clouds, hand, hotbar), no error in the log. - `backend_order` unit test for Windows / Linux / macOS / WGPU_BACKEND; shader translation tests (29 pass). - wgpu with `gles`+`dx12`+`vulkan` type-checks for `x86_64-pc-windows-msvc`. - Follow-ups (next PR): textures whose layer count makes GL guess the wrong view dimension, and a non-compute path for GL older than 4.3. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:51 +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#3863
No description provided.