...could this fix dual gpu on windows???
This commit is contained in:
parent
1bea7150b9
commit
7e0748b442
1 changed files with 8 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue