mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-25 08:51:05 +01:00
Prevent OpenGL from taking preference over Vulkan (#2853)
* Prevent OpenGL from taking preference over Vulkan * update changelog * fix wasm build of example
This commit is contained in:
1 parent
b574354af4
commit
1da5bbd7b4
6 files changed
+34
-10
No files matched your search
@@ -786,7 +786,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
let preferred_gpu = match desc.power_preference {
|
||||
PowerPreference::LowPower => integrated.or(other).or(discrete).or(virt).or(cpu),
|
||||
// Since devices of type "Other" might really be "Unknown" and come from APIs like OpenGL that don't specify device type,
|
||||
// Prefer more Specific types over Other.
|
||||
// This means that backends which do provide accurate device types will be preferred
|
||||
// if their device type indicates an actual hardware GPU (integrated or discrete).
|
||||
PowerPreference::LowPower => integrated.or(discrete).or(other).or(virt).or(cpu),
|
||||
PowerPreference::HighPerformance => discrete.or(integrated).or(other).or(virt).or(cpu),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user