Skip to content

Commit ba15f21

Browse files
authored
Merge pull request #26 from keller-mark/keller-mark/wgpu-26_0_1
Upgrade wgpu to v26.0.1
2 parents 763e0ab + 5a68840 commit ba15f21

File tree

5 files changed

+31
-32
lines changed

5 files changed

+31
-32
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ resolver = "2" # What does this do?
44
[package]
55
name = "vger"
66
description = "2D GPU renderer for dynamic UIs"
7-
version = "0.4.0"
7+
version = "0.5.0"
88
license = "MIT"
99
readme = "README.md"
1010
authors = ["Taylor Holliday <taylor@audulus.com>"]
@@ -16,9 +16,9 @@ edition = "2018"
1616
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717

1818
[dependencies]
19-
wgpu = "22"
19+
wgpu = "26.0.1"
2020
euclid = "0.22.7"
21-
fontdue = "0.9.0"
21+
fontdue = "0.9.3"
2222
rect_packer = "0.2.1"
2323

2424
[dev-dependencies]

src/atlas.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ impl Atlas {
9898
};
9999

100100
encoder.copy_buffer_to_texture(
101-
wgpu::ImageCopyBuffer {
101+
wgpu::TexelCopyBufferInfo {
102102
buffer: &buffer,
103-
layout: wgpu::ImageDataLayout {
103+
layout: wgpu::TexelCopyBufferLayout {
104104
offset: 0,
105105
bytes_per_row: Some(sz as u32),
106106
rows_per_image: None,
107107
},
108108
},
109-
wgpu::ImageCopyTexture {
109+
wgpu::TexelCopyTextureInfo {
110110
texture: &self.atlas_texture,
111111
mip_level: 0,
112112
aspect: wgpu::TextureAspect::All,
@@ -152,15 +152,15 @@ impl Atlas {
152152
};
153153

154154
encoder.copy_buffer_to_texture(
155-
wgpu::ImageCopyBuffer {
155+
wgpu::TexelCopyBufferInfo {
156156
buffer: &buffer,
157-
layout: wgpu::ImageDataLayout {
157+
layout: wgpu::TexelCopyBufferLayout {
158158
offset: 0,
159159
bytes_per_row: Some(padded_width as u32),
160160
rows_per_image: None,
161161
},
162162
},
163-
wgpu::ImageCopyTexture {
163+
wgpu::TexelCopyTextureInfo {
164164
texture: &self.atlas_texture,
165165
mip_level: 0,
166166
aspect: wgpu::TextureAspect::All,

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,13 @@ impl Vger {
227227
layout: Some(&pipeline_layout),
228228
vertex: wgpu::VertexState {
229229
module: &shader,
230-
entry_point: "vs_main",
230+
entry_point: Some("vs_main"),
231231
compilation_options: wgpu::PipelineCompilationOptions::default(),
232232
buffers: &[],
233233
},
234234
fragment: Some(wgpu::FragmentState {
235235
module: &shader,
236-
entry_point: "fs_main",
236+
entry_point: Some("fs_main"),
237237
compilation_options: wgpu::PipelineCompilationOptions::default(),
238238
targets: &[Some(wgpu::ColorTargetState {
239239
format: texture_format,
@@ -988,15 +988,15 @@ impl Vger {
988988
};
989989

990990
encoder.copy_buffer_to_texture(
991-
wgpu::ImageCopyBuffer {
991+
wgpu::TexelCopyBufferInfo {
992992
buffer: &buffer,
993-
layout: wgpu::ImageDataLayout {
993+
layout: wgpu::TexelCopyBufferLayout {
994994
offset: 0,
995995
bytes_per_row: Some(width * 4),
996996
rows_per_image: Some(height),
997997
},
998998
},
999-
wgpu::ImageCopyTexture {
999+
wgpu::TexelCopyTextureInfo {
10001000
texture: &texture,
10011001
mip_level: 0,
10021002
aspect: wgpu::TextureAspect::All,

src/shader.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ var<storage> xforms: XForms;
505505

506506
struct VertexOutput {
507507
@builtin(position) position: vec4<f32>,
508-
@location(0) prim_index: u32,
508+
@location(0) @interpolate(flat) prim_index: u32,
509509

510510
/// Texture space point.
511511
@location(1) t: vec2<f32>,

tests/common.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use vger::*;
55
pub async fn setup() -> (wgpu::Device, wgpu::Queue) {
66
let instance_desc = wgpu::InstanceDescriptor::default();
77

8-
let instance = wgpu::Instance::new(instance_desc);
8+
let instance = wgpu::Instance::new(&instance_desc);
99

1010
let adapter = wgpu::util::initialize_adapter_from_env_or_default(&instance, None)
1111
.await
@@ -14,17 +14,15 @@ pub async fn setup() -> (wgpu::Device, wgpu::Queue) {
1414
let adapter_info = adapter.get_info();
1515
println!("Using {} ({:?})", adapter_info.name, adapter_info.backend);
1616

17-
let trace_dir = std::env::var("WGPU_TRACE");
17+
let _trace_dir = std::env::var("WGPU_TRACE");
1818
adapter
19-
.request_device(
20-
&wgpu::DeviceDescriptor {
21-
label: None,
22-
required_features: wgpu::Features::default(),
23-
required_limits: wgpu::Limits::default(),
24-
memory_hints: wgpu::MemoryHints::Performance,
25-
},
26-
trace_dir.ok().as_ref().map(std::path::Path::new),
27-
)
19+
.request_device(&wgpu::DeviceDescriptor {
20+
label: None,
21+
required_features: wgpu::Features::default(),
22+
required_limits: wgpu::Limits::default(),
23+
memory_hints: wgpu::MemoryHints::Performance,
24+
trace: wgpu::Trace::Off,
25+
})
2826
.await
2927
.expect("Unable to find a suitable GPU adapter!")
3028
}
@@ -49,7 +47,7 @@ pub async fn create_png(
4947
// Poll the device in a blocking manner so that our future resolves.
5048
// In an actual application, `device.poll(...)` should
5149
// be called in an event loop or on another thread.
52-
device.poll(wgpu::Maintain::Wait);
50+
device.poll(wgpu::PollType::Wait);
5351
// If a file system is available, write the buffer as a PNG
5452
let has_file_system_available = cfg!(not(target_arch = "wasm32"));
5553
if !has_file_system_available {
@@ -112,9 +110,9 @@ fn get_texture_data(
112110
// Copy the data from the texture to the buffer
113111
encoder.copy_texture_to_buffer(
114112
texture.as_image_copy(),
115-
wgpu::ImageCopyBuffer {
113+
wgpu::TexelCopyBufferInfo {
116114
buffer: &output_buffer,
117-
layout: wgpu::ImageDataLayout {
115+
layout: wgpu::TexelCopyBufferLayout {
118116
offset: 0,
119117
bytes_per_row: Some(texture_extent.width * bytes_per_pixel),
120118
rows_per_image: None,
@@ -128,7 +126,7 @@ fn get_texture_data(
128126

129127
queue.submit(Some(command_buffer));
130128

131-
device.poll(wgpu::Maintain::Wait);
129+
device.poll(wgpu::PollType::Wait);
132130

133131
output_buffer
134132
}
@@ -141,7 +139,7 @@ pub fn render_test(
141139
capture: bool,
142140
) {
143141
if capture {
144-
device.start_capture();
142+
unsafe { device.start_graphics_debugger_capture() }
145143
}
146144

147145
let texture_size = wgpu::Extent3d {
@@ -174,6 +172,7 @@ pub fn render_test(
174172
load: wgpu::LoadOp::Clear(wgpu::Color::BLACK),
175173
store: wgpu::StoreOp::Store,
176174
},
175+
depth_slice: None,
177176
})],
178177
depth_stencil_attachment: None,
179178
occlusion_query_set: None,
@@ -185,7 +184,7 @@ pub fn render_test(
185184
let output_buffer = get_texture_data(&texture_desc, device, queue, &render_texture);
186185

187186
if capture {
188-
device.stop_capture();
187+
unsafe { device.stop_graphics_debugger_capture() }
189188
}
190189

191190
block_on(create_png(name, device, output_buffer, &texture_desc));

0 commit comments

Comments
 (0)