Graphics: the start-up log says which backend was chosen and how to change it

`Fallback::begin` returns before the fallback runs when `WGPU_BACKEND`
is set, logging that wgpu picks the backend. So the line below it is
reached only when the variable is *not* set -- and it said
"(WGPU_BACKEND overrides)", which reads in a log as though the user's
environment had chosen the backend when nothing had.

    before: graphics: DirectX 12 (WGPU_BACKEND overrides)
    after:  graphics: DirectX 12 (first choice; set WGPU_BACKEND to choose another)

The report quotes that line as evidence of which backend a start used,
which is exactly the wrong conclusion to be led to.

Part of #1343.
This commit is contained in:
Hamza
2026-10-20 18:26:44 +05:00
parent 15a2f3c8c8
commit e572a5316f
+4 -1
View File
@@ -231,7 +231,10 @@ impl Fallback {
choice.backend.name(),
choice.record.failed
),
None => log::info!("graphics: {} (WGPU_BACKEND overrides)", choice.backend.name()),
// `begin` returns before this when `WGPU_BACKEND` is set, so reaching here means it is
// not: the message said the opposite, which reads in a log as though the user's
// environment had chosen the backend (#1343).
None => log::info!("graphics: {} (first choice; set WGPU_BACKEND to choose another)", choice.backend.name()),
}
let instance = instance_backends(choice.backend, &choice.record.failed);
Some(Fallback { backend: choice.backend, switched_from: choice.switched_from, instance, path, record: choice.record })