Skip to content

Commit

Permalink
Merge #193
Browse files Browse the repository at this point in the history
193: Update pass.rs r=omni-viral a=malobre

Fix #182
Tested with some of the examples in rendy/examples.

Co-authored-by: Malobre <malobre@armanix.net>
  • Loading branch information
bors[bot] and Malobre committed Aug 30, 2019
2 parents 8f14145 + 561847a commit 08df51d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions graph/src/node/render/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,26 @@ where
failure::bail!("Surface {:?} presentation is unsupported by family {:?} bound to the node", surface, family);
}

let (caps, _f, present_modes_caps) = factory.get_surface_compatibility(&surface);

let present_mode = *present_modes_caps
.iter()
.max_by_key(|mode| match mode {
gfx_hal::PresentMode::Fifo => 3,
gfx_hal::PresentMode::Mailbox => 2,
gfx_hal::PresentMode::Relaxed => 1,
gfx_hal::PresentMode::Immediate => 0,
})
.unwrap();

let img_count_caps = caps.image_count;
let image_count = 3.min(*img_count_caps.end()).max(*img_count_caps.start());

let target = factory.create_target(
surface,
surface_extent,
3,
gfx_hal::window::PresentMode::Fifo,
image_count,
present_mode,
surface_usage,
)?;

Expand Down

0 comments on commit 08df51d

Please sign in to comment.