Request high performance adapter if MSAA is enabled

This commit is contained in:
Héctor Ramón Jiménez 2020-02-15 10:45:45 +01:00
parent dadae12253
commit fe61d2fd67
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,11 @@ impl iced_native::window::Backend for Backend {
fn new(settings: Self::Settings) -> (Backend, Renderer) { fn new(settings: Self::Settings) -> (Backend, Renderer) {
let adapter = wgpu::Adapter::request(&wgpu::RequestAdapterOptions { let adapter = wgpu::Adapter::request(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::Default, power_preference: if settings.antialiasing.is_none() {
wgpu::PowerPreference::Default
} else {
wgpu::PowerPreference::HighPerformance
},
backends: wgpu::BackendBit::all(), backends: wgpu::BackendBit::all(),
}) })
.expect("Request adapter"); .expect("Request adapter");