summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-11-24 00:17:59 +0100
committerLibravatar GitHub <noreply@github.com>2020-11-24 00:17:59 +0100
commit8f081bad7756e16a4eb0ca4dcb1144fc47de5e9b (patch)
tree337240be013a32ee5710e73f414e43356a3eac0f /wgpu
parent556cf24b95427cba403a62b32be20cbd0dee29d0 (diff)
parent0f00d1429793fc8547e843af67c96fe10d7ba637 (diff)
downloadiced-8f081bad7756e16a4eb0ca4dcb1144fc47de5e9b.tar.gz
iced-8f081bad7756e16a4eb0ca4dcb1144fc47de5e9b.tar.bz2
iced-8f081bad7756e16a4eb0ca4dcb1144fc47de5e9b.zip
Merge pull request #629 from hecrj/wgpu-present-mode-setting
Add `present_mode` field to `iced_wgpu::Settings`
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/settings.rs6
-rw-r--r--wgpu/src/window/compositor.rs2
2 files changed, 7 insertions, 1 deletions
diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs
index bc146c4c..07a180bb 100644
--- a/wgpu/src/settings.rs
+++ b/wgpu/src/settings.rs
@@ -11,6 +11,11 @@ pub struct Settings {
/// [`Renderer`]: ../struct.Renderer.html
pub format: wgpu::TextureFormat,
+ /// The present mode of the [`Renderer`].
+ ///
+ /// [`Renderer`]: ../struct.Renderer.html
+ pub present_mode: wgpu::PresentMode,
+
/// The bytes of the font that will be used by default.
///
/// If `None` is provided, a default system font will be chosen.
@@ -29,6 +34,7 @@ impl Default for Settings {
fn default() -> Settings {
Settings {
format: wgpu::TextureFormat::Bgra8UnormSrgb,
+ present_mode: wgpu::PresentMode::Mailbox,
default_font: None,
default_text_size: 20,
antialiasing: None,
diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs
index 79ffacdd..baa94d4e 100644
--- a/wgpu/src/window/compositor.rs
+++ b/wgpu/src/window/compositor.rs
@@ -111,9 +111,9 @@ impl iced_graphics::window::Compositor for Compositor {
&wgpu::SwapChainDescriptor {
usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT,
format: self.settings.format,
+ present_mode: self.settings.present_mode,
width,
height,
- present_mode: wgpu::PresentMode::Mailbox,
},
)
}