[wgpu 0.7] Update window/compositor.rs
Notes: - wgpu::PowerPreference::Default no longer exists, maybe there is another way to replicate its behavior.
This commit is contained in:
parent
2d76c7165c
commit
98d108d2b7
|
@ -27,7 +27,7 @@ impl Compositor {
|
||||||
let adapter = instance
|
let adapter = instance
|
||||||
.request_adapter(&wgpu::RequestAdapterOptions {
|
.request_adapter(&wgpu::RequestAdapterOptions {
|
||||||
power_preference: if settings.antialiasing.is_none() {
|
power_preference: if settings.antialiasing.is_none() {
|
||||||
wgpu::PowerPreference::Default
|
wgpu::PowerPreference::default()
|
||||||
} else {
|
} else {
|
||||||
wgpu::PowerPreference::HighPerformance
|
wgpu::PowerPreference::HighPerformance
|
||||||
},
|
},
|
||||||
|
@ -38,12 +38,14 @@ impl Compositor {
|
||||||
let (device, queue) = adapter
|
let (device, queue) = adapter
|
||||||
.request_device(
|
.request_device(
|
||||||
&wgpu::DeviceDescriptor {
|
&wgpu::DeviceDescriptor {
|
||||||
|
label: Some(
|
||||||
|
"iced_wgpu::window::Compositor Device Descriptor",
|
||||||
|
),
|
||||||
features: wgpu::Features::empty(),
|
features: wgpu::Features::empty(),
|
||||||
limits: wgpu::Limits {
|
limits: wgpu::Limits {
|
||||||
max_bind_groups: 2,
|
max_bind_groups: 2,
|
||||||
..wgpu::Limits::default()
|
..wgpu::Limits::default()
|
||||||
},
|
},
|
||||||
shader_validation: false,
|
|
||||||
},
|
},
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
|
@ -103,7 +105,7 @@ impl iced_graphics::window::Compositor for Compositor {
|
||||||
self.device.create_swap_chain(
|
self.device.create_swap_chain(
|
||||||
surface,
|
surface,
|
||||||
&wgpu::SwapChainDescriptor {
|
&wgpu::SwapChainDescriptor {
|
||||||
usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT,
|
usage: wgpu::TextureUsage::RENDER_ATTACHMENT,
|
||||||
format: self.settings.format,
|
format: self.settings.format,
|
||||||
present_mode: self.settings.present_mode,
|
present_mode: self.settings.present_mode,
|
||||||
width,
|
width,
|
||||||
|
@ -130,6 +132,7 @@ impl iced_graphics::window::Compositor for Compositor {
|
||||||
);
|
);
|
||||||
|
|
||||||
let _ = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
let _ = encoder.begin_render_pass(&wgpu::RenderPassDescriptor {
|
||||||
|
label: Some("iced_wgpu::window::Compositor Render Pass"),
|
||||||
color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor {
|
color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor {
|
||||||
attachment: &frame.output.view,
|
attachment: &frame.output.view,
|
||||||
resolve_target: None,
|
resolve_target: None,
|
||||||
|
|
Loading…
Reference in New Issue