mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
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:
@@ -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]
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user