Skip to content

feat: add renderer backend config option#595

Open
romanstingler wants to merge 1 commit intoMalpenZibo:mainfrom
romanstingler:feat/renderer-backend-config
Open

feat: add renderer backend config option#595
romanstingler wants to merge 1 commit intoMalpenZibo:mainfrom
romanstingler:feat/renderer-backend-config

Conversation

@romanstingler
Copy link
Copy Markdown
Collaborator

@romanstingler romanstingler commented Apr 2, 2026

Adds support for selecting Vulkan/OpenGL/Auto renderer backend via config.toml. Uses wgpu environment variables set before any initialization.

Automatic behavior:

  • Auto mode (default): automatically uses OpenGL when proprietary NVIDIA driver is detected, Vulkan for all other hardware (AMD/Intel/nouveau)
  • User can always explicitly select vulkan or opengl to override

Valid options:

  • auto (default)
  • vulkan - force Vulkan backend
  • opengl - force OpenGL backend

related to discussion #450 (comment)

Testing:

add this to your config's top level
renderer_backend = "auto"

run

RUST_LOG=wgpu=debug cargo run -- -c config.toml > /tmp/log (or whatever config you use)

Vulkan

INFO [wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "AMD Radeon 890M Graphics (RADV STRIX1)", vendor: 4098, device: 5390, device_type: IntegratedGpu, driver: "radv", driver_info: "Mesa 26.1.0-devel (git-d6958a5e43)", backend: Vulkan }

...
DEBUG [wgpu_core::present] Removing swapchain texture Id(6,37,vk) from the device tracker

and in OpenGL you will see

DEBUG [wgpu_core::present] Removing swapchain texture Id(6,30,gl) from the device tracker

@clotodex @MalpenZibo
It is the simplest I could come up with.

Adds support for selecting Vulkan/OpenGL/Auto renderer backend via
config.toml. Uses wgpu environment variables set before any initialization.

Automatic behavior:
- Auto mode (default): automatically uses OpenGL when proprietary NVIDIA
  driver is detected, Vulkan for all other hardware (AMD/Intel/nouveau)
- User can always explicitly select vulkan or opengl to override

Valid options:
- 'auto' (default)
- 'vulkan' - force Vulkan backend
- 'opengl' - force OpenGL backend
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