From 6899bcf0190db8185061b1d78cb7b258c8ed9bd7 Mon Sep 17 00:00:00 2001 From: wqLouis Date: Mon, 23 Feb 2026 21:06:05 +0800 Subject: [PATCH] docs(examples/wgpu): updated wgpu example to latest version. --- Cargo.toml | 2 +- examples/wgpu.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e8d7c335f..42f64a90c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ drm-fourcc = "2.2.0" font-kit = "0.11.0" image = "0.24" env_logger = "0.10" -wgpu = "0.19.0" +wgpu = "28.0.0" raqote = "0.8.2" raw-window-handle = "0.6.0" pollster = "0.3.0" diff --git a/examples/wgpu.rs b/examples/wgpu.rs index a583f6c64..d642fba16 100644 --- a/examples/wgpu.rs +++ b/examples/wgpu.rs @@ -46,7 +46,7 @@ fn main() { window.commit(); // Initialize wgpu - let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + let instance = wgpu::Instance::new(&wgpu::InstanceDescriptor { backends: wgpu::Backends::all(), ..Default::default() }); @@ -75,7 +75,7 @@ fn main() { })) .expect("Failed to find suitable adapter"); - let (device, queue) = pollster::block_on(adapter.request_device(&Default::default(), None)) + let (device, queue) = pollster::block_on(adapter.request_device(&Default::default())) .expect("Failed to request device"); let mut wgpu = Wgpu { @@ -253,6 +253,7 @@ impl WindowHandler for Wgpu { let _renderpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: None, color_attachments: &[Some(wgpu::RenderPassColorAttachment { + depth_slice: None, view: &texture_view, resolve_target: None, ops: wgpu::Operations { @@ -263,6 +264,7 @@ impl WindowHandler for Wgpu { depth_stencil_attachment: None, timestamp_writes: None, occlusion_query_set: None, + multiview_mask: None, }); }