[rs] Merge #33

33: Make `PresentMode` configurable. r=kvark a=Yatekii

See: https://github.com/gfx-rs/wgpu/pull/245

Co-authored-by: Noah Hüsser <yatekii@yatekii.ch>
This commit is contained in:
bors[bot]
2019-07-17 19:31:28 +00:00
4 changed files with 7 additions and 1 deletions

View File

@@ -24,7 +24,7 @@ gl = ["wgn/gfx-backend-gl"]
[dependencies]
#TODO: only depend on the published version
wgn = { package = "wgpu-native", version = "0.2.6", features = ["local", "window-winit"], git = "https://github.com/gfx-rs/wgpu", rev = "dbef9f397eda87b82ae1691b2f7e8ba0f3e2e5d2" }
wgn = { package = "wgpu-native", version = "0.2.6", features = ["local", "window-winit"], git = "https://github.com/gfx-rs/wgpu", rev = "32399cff8a0b55389f2d2493ea5c900c986c2547" }
arrayvec = "0.4"
[dev-dependencies]

View File

@@ -113,6 +113,7 @@ pub fn run<E: Example>(title: &str) {
format: wgpu::TextureFormat::Bgra8Unorm,
width: size.width.round() as u32,
height: size.height.round() as u32,
present_mode: wgpu::PresentMode::Vsync,
};
let mut swap_chain = device.create_swap_chain(&surface, &sc_desc);

View File

@@ -110,6 +110,7 @@ fn main() {
format: wgpu::TextureFormat::Bgra8Unorm,
width: size.width.round() as u32,
height: size.height.round() as u32,
present_mode: wgpu::PresentMode::Vsync,
},
);
let mut running = true;

View File

@@ -59,6 +59,7 @@ pub use wgn::{
TextureViewDimension,
VertexAttributeDescriptor,
VertexFormat,
PresentMode,
};
#[cfg(feature = "gl")]
@@ -503,6 +504,7 @@ impl Instance {
}
}
#[cfg(not(feature = "gl"))]
pub fn create_surface_from_xlib(
&self,
display: *mut *const std::ffi::c_void,
@@ -513,12 +515,14 @@ impl Instance {
}
}
#[cfg(not(feature = "gl"))]
pub fn create_surface_from_macos_layer(&self, layer: *mut std::ffi::c_void) -> Surface {
Surface {
id: wgn::wgpu_instance_create_surface_from_macos_layer(self.id, layer),
}
}
#[cfg(not(feature = "gl"))]
pub fn create_surface_from_windows_hwnd(
&self,
hinstance: *mut std::ffi::c_void,