diff --git a/Cargo.toml b/Cargo.toml index adaad50..8c51627 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,14 +22,15 @@ include = [ pollster = "0.2" raw-window-handle = "0.3" thiserror = "1.0" -ultraviolet = "0.7" -wgpu = "0.7" +ultraviolet = "0.8" +wgpu = "0.8.1" [dev-dependencies] pixels-mocks = { path = "internals/pixels-mocks" } winit = "0.24" [workspace] +resolver = "2" members = [ "examples/*", "internals/*", diff --git a/examples/custom-shader/src/main.rs b/examples/custom-shader/src/main.rs index a0164bc..8d737ed 100644 --- a/examples/custom-shader/src/main.rs +++ b/examples/custom-shader/src/main.rs @@ -147,7 +147,7 @@ fn create_noise_renderer(pixels: &Pixels) -> (wgpu::TextureView, NoiseRenderer) size: pixels::wgpu::Extent3d { width: WIDTH, height: HEIGHT, - depth: 1, + depth_or_array_layers: 1, }, mip_level_count: 1, sample_count: 1, diff --git a/examples/custom-shader/src/renderers.rs b/examples/custom-shader/src/renderers.rs index ccc0262..705314a 100644 --- a/examples/custom-shader/src/renderers.rs +++ b/examples/custom-shader/src/renderers.rs @@ -83,11 +83,11 @@ impl NoiseRenderer { }, wgpu::BindGroupEntry { binding: 2, - resource: wgpu::BindingResource::Buffer { + resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding { buffer: &time_buffer, offset: 0, size: None, - }, + }), }, ], }); @@ -114,8 +114,10 @@ impl NoiseRenderer { entry_point: "main", targets: &[wgpu::ColorTargetState { format: wgpu::TextureFormat::Bgra8UnormSrgb, - color_blend: wgpu::BlendState::REPLACE, - alpha_blend: wgpu::BlendState::REPLACE, + blend: Some(wgpu::BlendState { + color: wgpu::BlendComponent::REPLACE, + alpha: wgpu::BlendComponent::REPLACE, + }), write_mask: wgpu::ColorWrite::ALL, }], }), @@ -139,8 +141,8 @@ impl NoiseRenderer { ) { let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("NoiseRenderer render pass"), - color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { - attachment: render_target, + color_attachments: &[wgpu::RenderPassColorAttachment { + view: render_target, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Clear(wgpu::Color::BLACK), diff --git a/examples/egui-winit/Cargo.toml b/examples/egui-winit/Cargo.toml index b44d90a..38c0b69 100644 --- a/examples/egui-winit/Cargo.toml +++ b/examples/egui-winit/Cargo.toml @@ -10,9 +10,9 @@ optimize = ["log/release_max_level_warn"] default = ["optimize"] [dependencies] -egui = "0.10" -egui_wgpu_backend = { git = "https://github.com/hasenbanck/egui_wgpu_backend.git", rev = "9d03ad345d15d1e44165849b242d3562fdf3e859" } -egui_winit_platform = { git = "https://github.com/hasenbanck/egui_winit_platform.git", rev = "17298250e9721e8bf2c1d4a17b3e22777f8cb2e8" } +egui = "0.11" +egui_wgpu_backend = "0.7" +egui_winit_platform = "0.6" env_logger = "0.8" log = "0.4" pixels = { path = "../.." } diff --git a/examples/egui-winit/src/gui.rs b/examples/egui-winit/src/gui.rs index b95b55b..55f0a8f 100644 --- a/examples/egui-winit/src/gui.rs +++ b/examples/egui-winit/src/gui.rs @@ -96,7 +96,8 @@ impl Gui { ui.separator(); - ui.horizontal_for_text(egui::TextStyle::Body, |ui| { + ui.horizontal(|ui| { + ui.spacing_mut().item_spacing.x /= 2.0; ui.label("Learn more about egui at"); ui.hyperlink("https://docs.rs/egui"); }); diff --git a/examples/imgui-winit/Cargo.toml b/examples/imgui-winit/Cargo.toml index 7621eae..d0a76ef 100644 --- a/examples/imgui-winit/Cargo.toml +++ b/examples/imgui-winit/Cargo.toml @@ -12,7 +12,7 @@ default = ["optimize"] [dependencies] env_logger = "0.8" imgui = "0.7" -imgui-wgpu = "0.14" +imgui-wgpu = "0.15.1" imgui-winit-support = "0.7" log = "0.4" pixels = { path = "../.." } diff --git a/examples/imgui-winit/src/gui.rs b/examples/imgui-winit/src/gui.rs index f11eb22..e57dc60 100644 --- a/examples/imgui-winit/src/gui.rs +++ b/examples/imgui-winit/src/gui.rs @@ -115,8 +115,8 @@ impl Gui { // Render Dear ImGui with WGPU let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("imgui"), - color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { - attachment: render_target, + color_attachments: &[wgpu::RenderPassColorAttachment { + view: render_target, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Load, diff --git a/examples/minimal-fltk/Cargo.toml b/examples/minimal-fltk/Cargo.toml index bd9791a..4897ae4 100644 --- a/examples/minimal-fltk/Cargo.toml +++ b/examples/minimal-fltk/Cargo.toml @@ -10,7 +10,7 @@ optimize = ["log/release_max_level_warn"] default = ["optimize"] [dependencies] -fltk = { version = "0.15", features = ["no-pango"] } +fltk = { version = "1.0", features = ["no-images", "no-pango"] } env_logger = "0.8" log = "0.4" pixels = { path = "../.." } diff --git a/src/builder.rs b/src/builder.rs index 6ead492..db9d6a0 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -291,7 +291,7 @@ pub(crate) fn create_backing_texture( let texture_extent = wgpu::Extent3d { width, height, - depth: 1, + depth_or_array_layers: 1, }; let texture = device.create_texture(&wgpu::TextureDescriptor { diff --git a/src/lib.rs b/src/lib.rs index f0b1fbd..72064ec 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,6 +31,7 @@ pub use crate::builder::PixelsBuilder; pub use crate::renderers::ScalingRenderer; pub use raw_window_handle; +use std::num::NonZeroU32; pub use wgpu; use raw_window_handle::HasRawWindowHandle; @@ -359,16 +360,16 @@ impl Pixels { let bytes_per_row = (self.context.texture_extent.width as f32 * self.context.texture_format_size) as u32; self.context.queue.write_texture( - wgpu::TextureCopyView { + wgpu::ImageCopyTexture { texture: &self.context.texture, mip_level: 0, origin: wgpu::Origin3d { x: 0, y: 0, z: 0 }, }, &self.pixels, - wgpu::TextureDataLayout { + wgpu::ImageDataLayout { offset: 0, - bytes_per_row, - rows_per_image: self.context.texture_extent.height, + bytes_per_row: NonZeroU32::new(bytes_per_row), + rows_per_image: NonZeroU32::new(self.context.texture_extent.height), }, self.context.texture_extent, ); diff --git a/src/renderers.rs b/src/renderers.rs index a0f27d1..7d1f510 100644 --- a/src/renderers.rs +++ b/src/renderers.rs @@ -101,11 +101,11 @@ impl ScalingRenderer { }, wgpu::BindGroupEntry { binding: 2, - resource: wgpu::BindingResource::Buffer { + resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding { buffer: &uniform_buffer, offset: 0, size: None, - }, + }), }, ], }); @@ -132,8 +132,10 @@ impl ScalingRenderer { entry_point: "main", targets: &[wgpu::ColorTargetState { format: render_texture_format, - color_blend: wgpu::BlendState::REPLACE, - alpha_blend: wgpu::BlendState::REPLACE, + blend: Some(wgpu::BlendState { + color: wgpu::BlendComponent::REPLACE, + alpha: wgpu::BlendComponent::REPLACE, + }), write_mask: wgpu::ColorWrite::ALL, }], }), @@ -153,8 +155,8 @@ impl ScalingRenderer { // Draw the updated texture to the render target let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("pixels_scaling_renderer_render_pass"), - color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { - attachment: render_target, + color_attachments: &[wgpu::RenderPassColorAttachment { + view: render_target, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),