Skip to content

Commit 0c815db

Browse files
JMS55jasmine-nominalSyynthmockersfalice-i-cecile
authored
Upgrade to wgpu 27 and associated crates (#21746)
Supersedes #21725. --------- Co-authored-by: Jasmine Schweitzer <jasmine.schweitzer@nominal.io> Co-authored-by: Ben Cochrane <ben.cochrane2112@gmail.com> Co-authored-by: François Mockers <francois.mockers@vleue.com> Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: François Mockers <mockersf@gmail.com>
1 parent e610c53 commit 0c815db

File tree

18 files changed

+55
-40
lines changed

18 files changed

+55
-40
lines changed

crates/bevy_anti_alias/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bevy_diagnostic = { path = "../bevy_diagnostic", version = "0.18.0-dev" }
3434

3535
# other
3636
tracing = { version = "0.1", default-features = false, features = ["std"] }
37-
dlss_wgpu = { version = "1", optional = true }
37+
dlss_wgpu = { version = "2", optional = true }
3838
uuid = { version = "1", optional = true }
3939

4040
[lints]

crates/bevy_camera/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bevy_color = { path = "../bevy_color", version = "0.18.0-dev", features = [
2828
bevy_window = { path = "../bevy_window", version = "0.18.0-dev" }
2929

3030
# other
31-
wgpu-types = { version = "26", default-features = false }
31+
wgpu-types = { version = "27", default-features = false }
3232
serde = { version = "1", default-features = false, features = ["derive"] }
3333
thiserror = { version = "2", default-features = false }
3434
downcast-rs = { version = "2", default-features = false, features = ["std"] }

crates/bevy_color/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ serde = { version = "1.0", features = [
2020
], default-features = false, optional = true }
2121
thiserror = { version = "2", default-features = false }
2222
derive_more = { version = "2", default-features = false, features = ["from"] }
23-
wgpu-types = { version = "26", default-features = false, optional = true }
23+
wgpu-types = { version = "27", default-features = false, optional = true }
2424
encase = { version = "0.12", default-features = false, optional = true }
2525

2626
[features]

crates/bevy_image/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ image = { version = "0.25.2", default-features = false }
7070
# misc
7171
bitflags = { version = "2.3", features = ["serde"] }
7272
bytemuck = { version = "1.5" }
73-
wgpu-types = { version = "26", default-features = false }
73+
wgpu-types = { version = "27", default-features = false }
7474
serde = { version = "1", features = ["derive"] }
7575
thiserror = { version = "2", default-features = false }
7676
futures-lite = "2.0.1"

crates/bevy_mesh/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bevy_platform = { path = "../bevy_platform", version = "0.18.0-dev", default-fea
2727
# other
2828
bitflags = { version = "2.3", features = ["serde"] }
2929
bytemuck = { version = "1.5" }
30-
wgpu-types = { version = "26", default-features = false }
30+
wgpu-types = { version = "27", default-features = false }
3131
serde = { version = "1", default-features = false, features = [
3232
"derive",
3333
], optional = true }

crates/bevy_reflect/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ uuid = { version = "1.13.1", default-features = false, optional = true, features
125125
"serde",
126126
] }
127127
variadics_please = "1.1"
128-
wgpu-types = { version = "26", features = [
128+
wgpu-types = { version = "27", features = [
129129
"serde",
130130
], optional = true, default-features = false }
131131

crates/bevy_render/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,15 @@ image = { version = "0.25.2", default-features = false }
8585
# It is enabled for now to avoid having to do a significant overhaul of the renderer just for wasm.
8686
# When the 'atomics' feature is enabled `fragile-send-sync-non-atomic` does nothing
8787
# and Bevy instead wraps `wgpu` types to verify they are not used off their origin thread.
88-
wgpu = { version = "26", default-features = false, features = [
88+
wgpu = { version = "27", default-features = false, features = [
8989
"wgsl",
9090
"dx12",
9191
"metal",
9292
"vulkan",
9393
"naga-ir",
9494
"fragile-send-sync-non-atomic-wasm",
9595
] }
96-
naga = { version = "26", features = ["wgsl-in"] }
96+
naga = { version = "27", features = ["wgsl-in"] }
9797
bytemuck = { version = "1.5", features = ["derive", "must_cast"] }
9898
downcast-rs = { version = "2", default-features = false, features = ["std"] }
9999
thiserror = { version = "2", default-features = false }

crates/bevy_render/src/batching/gpu_preprocessing.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,9 @@ impl FromWorld for GpuPreprocessingSupport {
11091109
|| crate::get_mali_driver_version(adapter_info).is_some_and(|version| version < 48)
11101110
}
11111111

1112-
let culling_feature_support = device.features().contains(
1113-
Features::INDIRECT_FIRST_INSTANCE
1114-
| Features::MULTI_DRAW_INDIRECT
1115-
| Features::PUSH_CONSTANTS,
1116-
);
1112+
let culling_feature_support = device
1113+
.features()
1114+
.contains(Features::INDIRECT_FIRST_INSTANCE | Features::PUSH_CONSTANTS);
11171115
// Depth downsampling for occlusion culling requires 12 textures
11181116
let limit_support = device.limits().max_storage_textures_per_shader_stage >= 12 &&
11191117
// Even if the adapter supports compute, we might be simulating a lack of

crates/bevy_render/src/diagnostic/tracy_gpu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn initial_timestamp(device: &RenderDevice, queue: &RenderQueue) -> i64 {
6161

6262
map_buffer.slice(..).map_async(MapMode::Read, |_| ());
6363
device
64-
.poll(PollType::Wait)
64+
.poll(PollType::wait_indefinitely())
6565
.expect("Failed to poll device for map async");
6666

6767
let view = map_buffer.slice(..).get_mapped_range();

crates/bevy_render/src/render_resource/uniform_buffer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl<T: ShaderType + WriteInto> DynamicUniformBuffer<T> {
277277
max_count: usize,
278278
device: &RenderDevice,
279279
queue: &'a RenderQueue,
280-
) -> Option<DynamicUniformBufferWriter<'a, T>> {
280+
) -> Option<DynamicUniformBufferWriter<T>> {
281281
let alignment = if cfg!(target_abi = "sim") {
282282
// On iOS simulator on silicon macs, metal validation check that the host OS alignment
283283
// is respected, but the device reports the correct value for iOS, which is smaller.
@@ -357,27 +357,27 @@ impl<T: ShaderType + WriteInto> DynamicUniformBuffer<T> {
357357
/// A writer that can be used to directly write elements into the target buffer.
358358
///
359359
/// For more information, see [`DynamicUniformBuffer::get_writer`].
360-
pub struct DynamicUniformBufferWriter<'a, T> {
361-
buffer: encase::DynamicUniformBuffer<QueueWriteBufferViewWrapper<'a>>,
360+
pub struct DynamicUniformBufferWriter<T> {
361+
buffer: encase::DynamicUniformBuffer<QueueWriteBufferViewWrapper>,
362362
_marker: PhantomData<fn() -> T>,
363363
}
364364

365-
impl<'a, T: ShaderType + WriteInto> DynamicUniformBufferWriter<'a, T> {
365+
impl<T: ShaderType + WriteInto> DynamicUniformBufferWriter<T> {
366366
pub fn write(&mut self, value: &T) -> u32 {
367367
self.buffer.write(value).unwrap() as u32
368368
}
369369
}
370370

371-
/// A wrapper to work around the orphan rule so that [`wgpu::QueueWriteBufferView`] can implement
371+
/// A wrapper to work around the orphan rule so that [`wgpu::QueueWriteBufferView`] can implement
372372
/// [`BufferMut`].
373-
struct QueueWriteBufferViewWrapper<'a> {
374-
buffer_view: wgpu::QueueWriteBufferView<'a>,
373+
struct QueueWriteBufferViewWrapper {
374+
buffer_view: wgpu::QueueWriteBufferView,
375375
// Must be kept separately and cannot be retrieved from buffer_view, as the read-only access will
376376
// invoke a panic.
377377
capacity: usize,
378378
}
379379

380-
impl<'a> BufferMut for QueueWriteBufferViewWrapper<'a> {
380+
impl BufferMut for QueueWriteBufferViewWrapper {
381381
#[inline]
382382
fn capacity(&self) -> usize {
383383
self.capacity

0 commit comments

Comments
 (0)