diff --git a/gb-vst/src/ui.rs b/gb-vst/src/ui.rs index af36317..e71e1bb 100644 --- a/gb-vst/src/ui.rs +++ b/gb-vst/src/ui.rs @@ -12,7 +12,7 @@ use gb_emu_lib::{ }; use keyboard_types::{Code, KeyState}; use nih_plug::prelude::*; -use pixels::{Pixels, SurfaceTexture}; +use pixels::{wgpu::PowerPreference, Pixels, SurfaceTexture}; use crate::{FrameReceiver, JoypadSender}; @@ -121,12 +121,18 @@ fn init_pixbuf(info: WindowInfo, window: &mut Window) -> (Pixels, usize, Vec<[u8 let physical_size = info.physical_size(); let scale = (physical_size.width as usize / WIDTH).min(physical_size.height as usize / HEIGHT); let scaled_buf = vec![[0, 0, 0, 0xFF]; WIDTH * scale * HEIGHT * scale]; + ( - pixels::Pixels::new( + pixels::PixelsBuilder::new( physical_size.width, physical_size.height, SurfaceTexture::new(physical_size.width, physical_size.height, window), ) + .request_adapter_options(pixels::wgpu::RequestAdapterOptionsBase { + power_preference: PowerPreference::HighPerformance, + ..pixels::wgpu::RequestAdapterOptionsBase::default() + }) + .build() .unwrap(), scale, scaled_buf,