Skip to content

Commit

Permalink
Add debug + increase timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
blaind committed Nov 12, 2022
1 parent d536613 commit 48463bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion wgpu-core/src/present.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use hal::{Queue as _, Surface as _};
use thiserror::Error;
use wgt::SurfaceStatus as Status;

const FRAME_TIMEOUT_MS: u32 = 1000;
const FRAME_TIMEOUT_MS: u32 = 3_000;
pub const DESIRED_NUM_FRAMES: u32 = 3;

#[derive(Debug)]
Expand Down Expand Up @@ -134,6 +134,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {

let suf = A::get_surface_mut(surface);
let (texture_id, status) = match unsafe {
println!("Acquiring texture...");
suf.unwrap()
.raw
.acquire_texture(Some(std::time::Duration::from_millis(
Expand Down
1 change: 1 addition & 0 deletions wgpu-hal/src/vulkan/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ impl crate::Surface<super::Api> for super::Surface {
{
Ok(pair) => pair,
Err(error) => {
println!("ERR: {:?}, timeout_ns was: {}", error, timeout_ns);
return match error {
vk::Result::TIMEOUT => Ok(None),
vk::Result::NOT_READY | vk::Result::ERROR_OUT_OF_DATE_KHR => {
Expand Down
5 changes: 3 additions & 2 deletions wgpu/examples/hello-triangle/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
// the resources are properly cleaned up.
let _ = (&instance, &adapter, &shader, &pipeline_layout);

*control_flow = ControlFlow::Wait;
*control_flow = ControlFlow::Poll;
println!("EVENT: {:?}", event);
match event {
Event::WindowEvent {
event: WindowEvent::Resized(size),
Expand All @@ -97,7 +98,7 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
// On macos the window needs to be redrawn manually after resizing
window.request_redraw();
}
Event::RedrawRequested(_) => {
Event::RedrawRequested(_) | Event::MainEventsCleared => {
let frame = surface
.get_current_texture()
.expect("Failed to acquire next swap chain texture");
Expand Down

0 comments on commit 48463bb

Please sign in to comment.