Skip to content

Commit

Permalink
Request dual source blending feature during device creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakor Gyula committed Jan 23, 2019
1 parent 130e6c8 commit 28f7fe1
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions webrender/src/device/gfx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2092,9 +2092,32 @@ impl<B: hal::Backend> Device<B> {
let limits = adapter.physical_device.limits();
let max_texture_size = 4400u32; // TODO use limits after it points to the correct texture size

let (device, queue_group) = adapter
.open_with::<_, hal::Graphics>(1, |family| surface.supports_queue_family(family))
.unwrap();
let (device, queue_group) = {
use hal::Capability;
use hal::queue::QueueFamily;

let family = adapter
.queue_families
.iter()
.find(|family| {
hal::Graphics::supported_by(family.queue_type())
&& surface.supports_queue_family(&family)
})
.unwrap();

let priorities = vec![1.0];
let (id, families) = (family.id(), [(family, priorities.as_slice())]);
let hal::Gpu { device, mut queues } = unsafe {
adapter
.physical_device
.open(&families, hal::Features::DUAL_SRC_BLENDING)
.unwrap_or_else( |_| {
adapter.physical_device.open(&families, hal::Features::empty()).unwrap()
}
)
};
(device, queues.take(id).unwrap())
};

let (
swap_chain,
Expand Down

0 comments on commit 28f7fe1

Please sign in to comment.