Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
MESA_VERSION: "24.3.4"

# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.84"
REPO_MSRV: "1.88"
# This is the MSRV used by the `wgpu-core`, `wgpu-hal`, and `wgpu-types` crates,
# to ensure that they can be used with firefox.
CORE_MSRV: "1.82.0"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
MSRV: "1.84"
MSRV: "1.88"

jobs:
cts:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.84"
REPO_MSRV: "1.88"

CARGO_INCREMENTAL: false
CARGO_TERM_COLOR: always
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
#

# This is the MSRV used by `wgpu` itself and all surrounding infrastructure.
REPO_MSRV: "1.84"
REPO_MSRV: "1.88"
RUSTFLAGS: -D warnings

jobs:
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ref_as_ptr = "warn"

[workspace.package]
edition = "2021"
rust-version = "1.84"
rust-version = "1.88"
keywords = ["graphics"]
license = "MIT OR Apache-2.0"
homepage = "https://wgpu.rs/"
Expand Down Expand Up @@ -178,7 +178,7 @@ rustc-hash = { version = "1.1", default-features = false }
serde_json = "1.0.118"
serde = { version = "1.0.219", default-features = false }
shell-words = "1"
smallvec = "1.9"
smallvec = "1.13.1"
spirv = "0.3"
static_assertions = "1.1"
strum = { version = "0.27", default-features = false, features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ On Linux, you can point to them using `LD_LIBRARY_PATH` environment.

Due to complex dependants, we have two MSRV policies:

- `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types`'s MSRV is **1.76**.
- The rest of the workspace has an MSRV of **1.84**.
- `naga`, `wgpu-core`, `wgpu-hal`, and `wgpu-types`'s MSRV is **1.82**.
- The rest of the workspace has an MSRV of **1.88**.

It is enforced on CI (in "/.github/workflows/ci.yml") with the `CORE_MSRV` and `REPO_MSRV` variables.
This version can only be upgraded in breaking releases, though we release a breaking version every three months.
Expand Down
2 changes: 1 addition & 1 deletion benches/benches/wgpu-benchmark/bind_groups.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ fn run_bench(ctx: &mut Criterion) {
for &count in count_list {
group.throughput(Throughput::Elements(count as u64));
group.bench_with_input(
format!("{} Element Bind Group", count),
format!("{count} Element Bind Group"),
&count,
|b, &count| {
b.iter_custom(|iters| {
Expand Down
2 changes: 0 additions & 2 deletions clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@
disallowed-types = [
{ path = "std::collections::HashMap", reason = "use hashbrown::HashMap instead" },
{ path = "std::collections::HashSet", reason = "use hashbrown::HashSet instead" },
{ path = "rustc_hash::FxHashMap", reason = "use hashbrown::HashMap instead" },
{ path = "rustc_hash::FxHashSet", reason = "use hashbrown::HashSet instead" },
]
2 changes: 1 addition & 1 deletion cts_runner/test.lst
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ webgpu:api,operation,rendering,color_target_state:blend_constant,setting:*
webgpu:api,operation,rendering,depth:*
webgpu:api,operation,rendering,draw:*
webgpu:api,operation,shader_module,compilation_info:*
webgpu:api,operation,uncapturederror:iff_uncaptured:*
fails-if(metal) webgpu:api,operation,uncapturederror:iff_uncaptured:*
//FAIL: webgpu:shader,execution,expression,call,builtin,select:*
// - Fails with `const`/abstract int cases on all platforms because of <https://github.com/gfx-rs/wgpu/issues/4507>.
// - Fails with `vec3` & `f16` cases on macOS because of <https://github.com/gfx-rs/wgpu/issues/5262>.
Expand Down
4 changes: 2 additions & 2 deletions examples/features/src/big_compute_buffers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fn create_storage_buffers(device: &wgpu::Device, numbers: &[f32]) -> Vec<wgpu::B
.enumerate()
.map(|(e, seg)| {
device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
label: Some(&format!("Storage Buffer-{}", e)),
label: Some(&format!("Storage Buffer-{e}")),
contents: bytemuck::cast_slice(seg),
usage: wgpu::BufferUsages::STORAGE
| wgpu::BufferUsages::COPY_DST
Expand All @@ -211,7 +211,7 @@ fn create_staging_buffers(device: &wgpu::Device, numbers: &[f32]) -> Vec<wgpu::B
let size = std::mem::size_of_val(chunks[e]) as u64;

device.create_buffer(&wgpu::BufferDescriptor {
label: Some(&format!("staging buffer-{}", e)),
label: Some(&format!("staging buffer-{e}")),
size,
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST,
mapped_at_creation: false,
Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl FrameCounter {
let elapsed_ms = elapsed_secs * 1000.0;
let frame_time = elapsed_ms / self.frame_count as f32;
let fps = self.frame_count as f32 / elapsed_secs;
log::info!("Frame time {:.2}ms ({:.1} FPS)", frame_time, fps);
log::info!("Frame time {frame_time:.2}ms ({fps:.1} FPS)");

self.last_printed_instant = new_instant;
self.frame_count = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/features/src/hello_synchronization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ async fn run() {
} = execute(&device, &queue, ARR_SIZE).await;

// Print data
log::info!("Patient results: {:?}", patient_workgroup_results);
log::info!("Patient results: {patient_workgroup_results:?}");
if !patient_workgroup_results.iter().any(|e| *e != 16) {
log::info!("patient_main was patient.");
} else {
log::error!("patient_main was not patient!");
}
log::info!("Hasty results: {:?}", hasty_workgroup_results);
log::info!("Hasty results: {hasty_workgroup_results:?}");
if hasty_workgroup_results.iter().any(|e| *e != 16) {
log::info!("hasty_main was not patient.");
} else {
Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/msaa_line/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl Example {
vertex_buffer: &wgpu::Buffer,
vertex_count: u32,
) -> wgpu::RenderBundle {
log::info!("sample_count: {}", sample_count);
log::info!("sample_count: {sample_count}");
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
label: None,
layout: Some(pipeline_layout),
Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/ray_cube_compute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl<F: Future<Output = Option<wgpu::Error>>> Future for ErrorFuture<F> {
let inner = unsafe { self.map_unchecked_mut(|me| &mut me.inner) };
inner.poll(cx).map(|error| {
if let Some(e) = error {
panic!("Rendering {}", e);
panic!("Rendering {e}");
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/ray_cube_fragment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl<F: Future<Output = Option<wgpu::Error>>> Future for ErrorFuture<F> {
let inner = unsafe { self.map_unchecked_mut(|me| &mut me.inner) };
inner.poll(cx).map(|error| {
if let Some(e) = error {
panic!("Rendering {}", e);
panic!("Rendering {e}");
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/ray_cube_normals/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<F: Future<Output = Option<wgpu::Error>>> Future for ErrorFuture<F> {
let inner = unsafe { self.map_unchecked_mut(|me| &mut me.inner) };
inner.poll(cx).map(|error| {
if let Some(e) = error {
panic!("Rendering {}", e);
panic!("Rendering {e}");
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions examples/features/src/ray_scene/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl<F: Future<Output = Option<wgpu::Error>>> Future for ErrorFuture<F> {
let inner = unsafe { self.map_unchecked_mut(|me| &mut me.inner) };
inner.poll(cx).map(|error| {
if let Some(e) = error {
panic!("Rendering {}", e);
panic!("Rendering {e}");
}
})
}
Expand Down Expand Up @@ -93,7 +93,7 @@ struct Material {

fn load_model(scene: &mut RawSceneComponents, path: &str) {
let path = env!("CARGO_MANIFEST_DIR").to_string() + "/src" + path;
println!("{}", path);
println!("{path}");
let mut object = obj::Obj::load(path).unwrap();
object.load_mtls().unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples/features/src/ray_shadows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl<F: Future<Output = Option<wgpu::Error>>> Future for ErrorFuture<F> {
let inner = unsafe { self.map_unchecked_mut(|me| &mut me.inner) };
inner.poll(cx).map(|error| {
if let Some(e) = error {
panic!("Rendering {}", e);
panic!("Rendering {e}");
}
})
}
Expand Down
6 changes: 1 addition & 5 deletions examples/features/src/skybox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,7 @@ impl crate::framework::Example for Example {
let max_mips = layer_size.max_mips(wgpu::TextureDimension::D2);

log::debug!(
"Copying {:?} skybox images of size {}, {}, 6 with {} mips to gpu",
skybox_format,
IMAGE_SIZE,
IMAGE_SIZE,
max_mips,
"Copying {skybox_format:?} skybox images of size {IMAGE_SIZE}, {IMAGE_SIZE}, 6 with {max_mips} mips to gpu",
);

let bytes = match skybox_format {
Expand Down
10 changes: 4 additions & 6 deletions examples/features/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn output_image_native(image_data: Vec<u8>, texture_dims: (usize, usize), pa

let mut file = std::fs::File::create(&path).unwrap();
file.write_all(&png_data[..]).unwrap();
log::info!("PNG file written to disc as \"{}\".", path);
log::info!("PNG file written to disc as \"{path}\".");
}

/// Effectively a version of `output_image_native` but meant for web browser contexts.
Expand All @@ -58,9 +58,8 @@ pub fn output_image_wasm(image_data: Vec<u8>, texture_dims: (usize, usize)) {
Err(e) => {
log::error!(
"In searching for a staging canvas for outputting an image \
(element with id \"staging-canvas\"), found non-canvas element: {:?}.
Replacing with standard staging canvas.",
e
(element with id \"staging-canvas\"), found non-canvas element: {e:?}.
Replacing with standard staging canvas."
);
e.remove();
create_staging_canvas(&document)
Expand Down Expand Up @@ -101,9 +100,8 @@ pub fn output_image_wasm(image_data: Vec<u8>, texture_dims: (usize, usize)) {
Ok(e) => e,
Err(e) => {
log::error!(
"Found an element with the id \"output-image-target\" but it was not an image: {:?}.
"Found an element with the id \"output-image-target\" but it was not an image: {e:?}.
Replacing with default image output element.",
e
);
e.remove();
create_output_image_element(&document)
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/01_hello_compute/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-01-hello-compute"
edition = "2021"
rust-version = "1.84"
rust-version = "1.88"
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/01_hello_compute/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,5 @@ fn main() {
let result: &[f32] = bytemuck::cast_slice(&data);

// Print out the result.
println!("Result: {:?}", result);
println!("Result: {result:?}");
}
2 changes: 1 addition & 1 deletion examples/standalone/02_hello_window/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-02-hello-window"
edition = "2021"
rust-version = "1.84"
rust-version = "1.88"
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/custom_backend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wgpu-example-custom-backend"
edition = "2021"
rust-version = "1.84"
rust-version = "1.88"
publish = false

[features]
Expand Down
2 changes: 1 addition & 1 deletion naga/src/back/dot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ fn write_function_expressions(
E::RayQueryVertexPositions { query, committed } => {
edges.insert("", query);
let ty = if committed { "Committed" } else { "Candidate" };
(format!("get{}HitVertexPositions", ty).into(), 4)
(format!("get{ty}HitVertexPositions").into(), 4)
}
};

Expand Down
8 changes: 4 additions & 4 deletions naga/src/back/glsl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ impl<'a, W: Write> Writer<'a, W> {
write!(self.out, "layout(")?;

if let Some(layout) = layout {
write!(self.out, "{}, ", layout)?;
write!(self.out, "{layout}, ")?;
}

write!(self.out, "binding = {binding}) ")?;
Expand All @@ -1255,7 +1255,7 @@ impl<'a, W: Write> Writer<'a, W> {
// Either no explicit bindings are supported or we didn't have any.
// Write just the memory layout.
if let Some(layout) = layout {
write!(self.out, "layout({}) ", layout)?;
write!(self.out, "layout({layout}) ")?;
}

Ok(())
Expand Down Expand Up @@ -3698,11 +3698,11 @@ impl<'a, W: Write> Writer<'a, W> {
// `Dot4U8Packed`, the code below only introduces parenthesis around
// each factor, which aren't strictly needed because both operands are
// baked, but which don't hurt either.
write!(self.out, "bitfieldExtract({}(", conversion)?;
write!(self.out, "bitfieldExtract({conversion}(")?;
self.write_expr(arg, ctx)?;
write!(self.out, "), {}, 8)", i * 8)?;

write!(self.out, " * bitfieldExtract({}(", conversion)?;
write!(self.out, " * bitfieldExtract({conversion}(")?;
self.write_expr(arg1, ctx)?;
write!(self.out, "), {}, 8)", i * 8)?;

Expand Down
6 changes: 3 additions & 3 deletions naga/src/back/hlsl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
}

for (group, bt) in self.options.dynamic_storage_buffer_offsets_targets.iter() {
writeln!(self.out, "struct __dynamic_buffer_offsetsTy{} {{", group)?;
writeln!(self.out, "struct __dynamic_buffer_offsetsTy{group} {{")?;
for i in 0..bt.size {
writeln!(self.out, "{}uint _{};", back::INDENT, i)?;
}
Expand Down Expand Up @@ -706,7 +706,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
let members = match module.types[result.ty].inner {
TypeInner::Struct { ref members, .. } => members,
ref other => {
log::error!("Unexpected {:?} output type without a binding", other);
log::error!("Unexpected {other:?} output type without a binding");
&empty[..]
}
};
Expand Down Expand Up @@ -1433,7 +1433,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
let array_return_type = self.namer.call(&format!("ret_{name}"));
write!(self.out, "typedef ")?;
self.write_type(module, result.ty)?;
write!(self.out, " {}", array_return_type)?;
write!(self.out, " {array_return_type}")?;
self.write_array_size(module, base, size)?;
writeln!(self.out, ";")?;
Some(array_return_type)
Expand Down
8 changes: 4 additions & 4 deletions naga/src/back/msl/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ impl<W: Write> Writer<W> {
//TODO: do we support Zero on `Sampled` image classes?
}
_ if !has_levels => {
log::warn!("1D image can't be sampled with level {:?}", level);
log::warn!("1D image can't be sampled with level {level:?}");
}
crate::SampleLevel::Exact(h) => {
write!(self.out, ", {NAMESPACE}::level(")?;
Expand Down Expand Up @@ -1397,7 +1397,7 @@ impl<W: Write> Writer<W> {
} else {
fun.to_msl()
};
write!(self.out, ".atomic_{}(", op)?;
write!(self.out, ".atomic_{op}(")?;
// coordinates in IR are int, but Metal expects uint
self.put_cast_to_uint_scalar_or_vector(address.coordinate, &context.expression)?;
write!(self.out, ", ")?;
Expand Down Expand Up @@ -2352,7 +2352,7 @@ impl<W: Write> Writer<W> {
arg1.unwrap(),
4,
|writer, arg, index| {
write!(writer.out, "({}(", conversion)?;
write!(writer.out, "({conversion}(")?;
writer.put_expression(arg, context, true)?;
if index == 3 {
write!(writer.out, ") >> 24)")?;
Expand Down Expand Up @@ -3420,7 +3420,7 @@ impl<W: Write> Writer<W> {
put_numeric_type(&mut self.out, scalar, &[rows, columns])?;
}
TypeResolution::Value(ref other) => {
log::warn!("Type {:?} isn't a known local", other); //TEMP!
log::warn!("Type {other:?} isn't a known local"); //TEMP!
return Err(Error::FeatureNotImplemented("weird local type".to_string()));
}
}
Expand Down
4 changes: 2 additions & 2 deletions naga/src/back/spv/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ impl BlockContext<'_> {
load_id
}
ref other => {
log::error!("Unable to access index of {:?}", other);
log::error!("Unable to access index of {other:?}");
return Err(Error::FeatureNotImplemented("access index for type"));
}
}
Expand Down Expand Up @@ -1893,7 +1893,7 @@ impl BlockContext<'_> {
crate::TypeInner::Scalar(scalar) => (scalar, None),
crate::TypeInner::Vector { scalar, size } => (scalar, Some(size)),
ref other => {
log::error!("As source {:?}", other);
log::error!("As source {other:?}");
return Err(Error::Validation("Unexpected Expression::As source"));
}
};
Expand Down
Loading
Loading