Adapt to changes in wgpu for a configurable PresentMode.

Gl fixes.

Try fix this mess ..

GL fixess

Revert intermediate wgpu branch

Set proper wgpu-native commit ref

Adapt examples to the new features.
This commit is contained in:
Noah Hüsser
2019-07-03 22:47:13 +02:00
parent a05eab15a1
commit ce382f3735
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,