Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
parasyte authored and Yatekii committed Jan 27, 2023
1 parent 6fd2409 commit 28ae43d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ min = 0 # allow non-first increment

[dependencies]
bytemuck = "1"
imgui = "0.9"
imgui = "0.10"
log = "0.4"
smallvec = "1"
wgpu = "0.14"
wgpu = "0.15"

[dev-dependencies]
bytemuck = { version = "1.4", features = ["derive"] }
cgmath = "0.18"
env_logger = "0.10"
image = { version = "0.24", default-features = false, features = ["png"] }
imgui-winit-support = { version = "0.9" }
imgui-winit-support = { version = "0.10" }
pollster = "0.2"
raw-window-handle = "0.5"
winit = "0.27.5"
Expand Down
10 changes: 8 additions & 2 deletions examples/cube.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl Example {
dimension: wgpu::TextureDimension::D2,
format: wgpu::TextureFormat::R8Uint,
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
view_formats: &[wgpu::TextureFormat::R8Uint],
});
let texture_view = texture.create_view(&wgpu::TextureViewDescriptor::default());
queue.write_texture(
Expand Down Expand Up @@ -331,7 +332,10 @@ fn main() {
// Set up window and GPU
let event_loop = EventLoop::new();

let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY);
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::PRIMARY,
..Default::default()
});

let (window, size, surface) = {
let version = env!("CARGO_PKG_VERSION");
Expand All @@ -344,7 +348,7 @@ fn main() {
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();

let surface = unsafe { instance.create_surface(&window) };
let surface = unsafe { instance.create_surface(&window) }.unwrap();

(window, size, surface)
};
Expand All @@ -369,6 +373,7 @@ fn main() {
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![wgpu::TextureFormat::Bgra8Unorm],
};

surface.configure(&device, &surface_desc);
Expand Down Expand Up @@ -456,6 +461,7 @@ fn main() {
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![wgpu::TextureFormat::Bgra8Unorm],
};

surface.configure(&device, &surface_desc);
Expand Down
9 changes: 7 additions & 2 deletions examples/custom-texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ fn main() {
// Set up window and GPU
let event_loop = EventLoop::new();

let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY);
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::PRIMARY,
..Default::default()
});

let (window, size, surface) = {
let version = env!("CARGO_PKG_VERSION");
Expand All @@ -30,7 +33,7 @@ fn main() {
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();

let surface = unsafe { instance.create_surface(&window) };
let surface = unsafe { instance.create_surface(&window) }.unwrap();

(window, size, surface)
};
Expand Down Expand Up @@ -62,6 +65,7 @@ fn main() {
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![wgpu::TextureFormat::Bgra8Unorm],
};

surface.configure(&device, &surface_desc);
Expand Down Expand Up @@ -153,6 +157,7 @@ fn main() {
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![wgpu::TextureFormat::Bgra8Unorm],
};

surface.configure(&device, &surface_desc);
Expand Down
9 changes: 7 additions & 2 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ fn main() {
// Set up window and GPU
let event_loop = EventLoop::new();

let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY);
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: wgpu::Backends::PRIMARY,
..Default::default()
});

let (window, size, surface) = {
let version = env!("CARGO_PKG_VERSION");
Expand All @@ -31,7 +34,7 @@ fn main() {
window.set_title(&format!("imgui-wgpu {version}"));
let size = window.inner_size();

let surface = unsafe { instance.create_surface(&window) };
let surface = unsafe { instance.create_surface(&window) }.unwrap();

(window, size, surface)
};
Expand All @@ -56,6 +59,7 @@ fn main() {
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![wgpu::TextureFormat::Bgra8Unorm],
};

surface.configure(&device, &surface_desc);
Expand Down Expand Up @@ -125,6 +129,7 @@ fn main() {
height: size.height,
present_mode: wgpu::PresentMode::Fifo,
alpha_mode: wgpu::CompositeAlphaMode::Auto,
view_formats: vec![wgpu::TextureFormat::Bgra8Unorm],
};

surface.configure(&device, &surface_desc);
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<'a> Default for TextureConfig<'a> {
mag_filter: FilterMode::Linear,
min_filter: FilterMode::Linear,
mipmap_filter: FilterMode::Linear,
lod_min_clamp: -100.0,
lod_min_clamp: 0.0,
lod_max_clamp: 100.0,
compare: None,
anisotropy_clamp: None,
Expand Down Expand Up @@ -178,6 +178,7 @@ impl Texture {
dimension: config.dimension,
format: config.format.unwrap_or(renderer.config.texture_format),
usage: config.usage,
view_formats: &[config.format.unwrap_or(renderer.config.texture_format)],
}));

// Extract the texture view.
Expand Down

0 comments on commit 28ae43d

Please sign in to comment.