review pass the last
This commit is contained in:
@@ -440,10 +440,12 @@ fn create_dns_pool() -> io::Result<BlockingPool> {
|
|||||||
.map(usize::from)
|
.map(usize::from)
|
||||||
.unwrap_or(2)
|
.unwrap_or(2)
|
||||||
.clamp(2, 4);
|
.clamp(2, 4);
|
||||||
|
let mut spawned = 0usize;
|
||||||
|
let mut last_error = None;
|
||||||
|
|
||||||
for index in 0..worker_count {
|
for index in 0..worker_count {
|
||||||
let receiver = Arc::clone(&receiver);
|
let receiver = Arc::clone(&receiver);
|
||||||
thread::Builder::new()
|
match thread::Builder::new()
|
||||||
.name(format!("ruin-runtime-dns-{index}"))
|
.name(format!("ruin-runtime-dns-{index}"))
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
loop {
|
loop {
|
||||||
@@ -456,8 +458,16 @@ fn create_dns_pool() -> io::Result<BlockingPool> {
|
|||||||
Err(_) => break,
|
Err(_) => break,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}) {
|
||||||
.map_err(io::Error::other)?;
|
Ok(_) => spawned += 1,
|
||||||
|
Err(error) => last_error = Some(error),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if spawned == 0 {
|
||||||
|
return Err(io::Error::other(last_error.expect(
|
||||||
|
"at least one DNS worker spawn should have been attempted",
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(BlockingPool { sender })
|
Ok(BlockingPool { sender })
|
||||||
@@ -593,7 +603,7 @@ impl RawSocketAddr {
|
|||||||
sin_family: libc::AF_INET as libc::sa_family_t,
|
sin_family: libc::AF_INET as libc::sa_family_t,
|
||||||
sin_port: addr.port().to_be(),
|
sin_port: addr.port().to_be(),
|
||||||
sin_addr: libc::in_addr {
|
sin_addr: libc::in_addr {
|
||||||
s_addr: u32::from_ne_bytes(addr.ip().octets()),
|
s_addr: u32::from_be_bytes(addr.ip().octets()).to_be(),
|
||||||
},
|
},
|
||||||
sin_zero: [0; 8],
|
sin_zero: [0; 8],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -460,6 +460,10 @@ pub fn run_macos_app_event_loop() {
|
|||||||
unsafe {
|
unsafe {
|
||||||
let _: () = objc2::msg_send![app, run];
|
let _: () = objc2::msg_send![app, run];
|
||||||
}
|
}
|
||||||
|
set_command_wake_hook(None);
|
||||||
|
if let Ok(mut slot) = run_loop_wake_handle().lock() {
|
||||||
|
*slot = None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn install_platform_run_loop_source() -> Option<RunLoopSourceRegistration> {
|
fn install_platform_run_loop_source() -> Option<RunLoopSourceRegistration> {
|
||||||
@@ -1174,9 +1178,6 @@ fn drain_platform_commands(state: &Rc<RefCell<MacosState>>) -> bool {
|
|||||||
let _: () = objc2::msg_send![app, stop: std::ptr::null_mut::<AnyObject>()];
|
let _: () = objc2::msg_send![app, stop: std::ptr::null_mut::<AnyObject>()];
|
||||||
}
|
}
|
||||||
set_command_wake_hook(None);
|
set_command_wake_hook(None);
|
||||||
if let Ok(mut slot) = run_loop_wake_handle().lock() {
|
|
||||||
*slot = None;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -369,6 +369,9 @@ impl WgpuSceneRenderer {
|
|||||||
format,
|
format,
|
||||||
width: width.max(1),
|
width: width.max(1),
|
||||||
height: height.max(1),
|
height: height.max(1),
|
||||||
|
// RUIN prioritizes immediate resize/input feedback over frame pacing
|
||||||
|
// here. Keep latency to one frame and let callers opt into a more
|
||||||
|
// power-conservative policy once presentation settings are exposed.
|
||||||
present_mode: wgpu::PresentMode::AutoNoVsync,
|
present_mode: wgpu::PresentMode::AutoNoVsync,
|
||||||
desired_maximum_frame_latency: 1,
|
desired_maximum_frame_latency: 1,
|
||||||
alpha_mode: caps.alpha_modes[0],
|
alpha_mode: caps.alpha_modes[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user