Skip to content

Commit 10e8e6b

Browse files
committed
Update wgpu to 47fd776
1 parent afd5c28 commit 10e8e6b

File tree

8 files changed

+57
-67
lines changed

8 files changed

+57
-67
lines changed

Cargo.lock

+40-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ rust-ini = "0.17"
6060
serde = "1.0"
6161
serde_derive = "1.0"
6262
serde_scan = "0.4"
63-
wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "8f02b73", features = [] }
63+
wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "47fd776", features = [] }
6464
# binaries
6565
env_logger = "0.8"
6666
getopts = "0.2"
@@ -69,8 +69,8 @@ png = "0.16"
6969
winit = "0.25"
7070

7171
[dev-dependencies]
72-
#naga = { git = "https://github.com/gfx-rs/naga", rev = "7613798", features = ["wgsl-in"] }
73-
naga = { version = "0.6", features = ["wgsl-in"] }
72+
naga = { git = "https://github.com/gfx-rs/naga", rev = "eda078d", features = ["wgsl-in"] }
73+
#naga = { version = "0.6", features = ["wgsl-in"] }
7474

7575
[dependencies.profiling]
7676
version = "1.0.1"
@@ -80,6 +80,7 @@ default-features = false
8080
#naga = { path = "../naga" }
8181

8282
[patch."https://github.com/gfx-rs/wgpu"]
83+
#wgpu = { path = "../wgpu/wgpu" }
8384
#wgpu-hal = { path = "../wgpu/wgpu-hal" }
8485
#wgpu-core = { path = "../wgpu/wgpu-core" }
8586
#wgpu-types = { path = "../wgpu/wgpu-types" }

bin/boilerplate.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ impl Harness {
7979
.run_until(instance.request_adapter(&wgpu::RequestAdapterOptions {
8080
power_preference: wgpu::PowerPreference::HighPerformance,
8181
compatible_surface: Some(&surface),
82+
force_fallback_adapter: false,
8283
}))
8384
.expect("Unable to initialize GPU via the selected backend.");
8485

@@ -227,10 +228,9 @@ impl Harness {
227228
queue.submit(update_command_buffers);
228229
}
229230

230-
match surface.get_current_frame() {
231+
match surface.get_current_texture() {
231232
Ok(frame) => {
232233
let view = frame
233-
.output
234234
.texture
235235
.create_view(&wgpu::TextureViewDescriptor::default());
236236
let targets = ScreenTargets {
@@ -240,6 +240,7 @@ impl Harness {
240240
};
241241
let render_command_buffer = app.draw(&device, targets, &spawner);
242242
queue.submit(Some(render_command_buffer));
243+
frame.present();
243244
}
244245
Err(_) => {}
245246
};

res/shader/body.inc.wgsl

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct DragConstants {
3636
abs_stop: vec2<f32>;
3737
coll: vec2<f32>;
3838
other: vec2<f32>; // X = wheel speed, Y = drag Z
39-
_pad: vec2<f32>;
39+
padding: vec2<f32>;
4040
};
4141

4242
struct GlobalConstants {

src/render/collision.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ impl GpuCollider {
247247
contents: bytemuck::bytes_of(&globals),
248248
usage: wgpu::BufferUsages::UNIFORM,
249249
});
250-
let locals_size = mem::size_of::<Locals>().max(wgpu::BIND_BUFFER_ALIGNMENT as usize);
250+
//TODO: device.limits().min_uniform_buffer_offset_alignment
251+
let locals_size = mem::size_of::<Locals>().max(256);
251252
let locals_total_size = (settings.max_objects * locals_size) as wgpu::BufferAddress;
252253
let local_uniforms = device.create_buffer(&wgpu::BufferDescriptor {
253254
label: Some("Collision Locals"),

src/render/global.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ impl Context {
6565
wgpu::BindGroupLayoutEntry {
6666
binding: 1,
6767
visibility: wgpu::ShaderStages::all(),
68-
ty: wgpu::BindingType::Sampler {
69-
filtering: true,
70-
comparison: false,
71-
},
68+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
7269
count: None,
7370
},
7471
// GPU store
@@ -98,10 +95,7 @@ impl Context {
9895
wgpu::BindGroupLayoutEntry {
9996
binding: 4,
10097
visibility: wgpu::ShaderStages::FRAGMENT,
101-
ty: wgpu::BindingType::Sampler {
102-
filtering: true,
103-
comparison: true,
104-
},
98+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Comparison),
10599
count: None,
106100
},
107101
],

src/render/object.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl Context {
161161
primitive: wgpu::PrimitiveState {
162162
topology: wgpu::PrimitiveTopology::TriangleList,
163163
front_face: wgpu::FrontFace::Ccw,
164-
clamp_depth: false,
164+
unclipped_depth: false,
165165
..Default::default()
166166
},
167167
depth_stencil: Some(wgpu::DepthStencilState {
@@ -261,10 +261,7 @@ impl Context {
261261
wgpu::BindGroupLayoutEntry {
262262
binding: 2,
263263
visibility: wgpu::ShaderStages::VERTEX,
264-
ty: wgpu::BindingType::Sampler {
265-
filtering: false,
266-
comparison: false,
267-
},
264+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::NonFiltering),
268265
count: None,
269266
},
270267
],

src/render/terrain.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -645,30 +645,21 @@ impl Context {
645645
wgpu::BindGroupLayoutEntry {
646646
binding: 7,
647647
visibility: wgpu::ShaderStages::all(),
648-
ty: wgpu::BindingType::Sampler {
649-
filtering: true,
650-
comparison: false,
651-
},
648+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
652649
count: None,
653650
},
654651
// flood sampler
655652
wgpu::BindGroupLayoutEntry {
656653
binding: 8,
657654
visibility: wgpu::ShaderStages::FRAGMENT | wgpu::ShaderStages::COMPUTE,
658-
ty: wgpu::BindingType::Sampler {
659-
filtering: true,
660-
comparison: false,
661-
},
655+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
662656
count: None,
663657
},
664658
// table sampler
665659
wgpu::BindGroupLayoutEntry {
666660
binding: 9,
667661
visibility: wgpu::ShaderStages::FRAGMENT,
668-
ty: wgpu::BindingType::Sampler {
669-
filtering: true,
670-
comparison: false,
671-
},
662+
ty: wgpu::BindingType::Sampler(wgpu::SamplerBindingType::Filtering),
672663
count: None,
673664
},
674665
],

0 commit comments

Comments
 (0)