chore: use std::mem::size_of{,_val} s'more

As before, this is to minimize diffs. with Rust 1.80.
This commit is contained in:
Erich Gubler committed 2024-09-03 10:18:25 -04:00
1 parent e1c0aed520
commit 85346dfd20
30 files changed
+126 -111

No files matched your search

+4 -2
View File
@@ -7,6 +7,8 @@
//!
//! Only parts specific to this example will be commented.
use std::mem::size_of_val;
use wgpu::util::DeviceExt;
async fn run() {
@@ -56,7 +58,7 @@ async fn run() {
});
let output_staging_buffer = device.create_buffer(&wgpu::BufferDescriptor {
label: None,
size: std::mem::size_of_val(&local_a) as u64,
size: size_of_val(&local_a) as u64,
usage: wgpu::BufferUsages::COPY_DST | wgpu::BufferUsages::MAP_READ,
mapped_at_creation: false,
});
@@ -169,7 +171,7 @@ async fn get_data<T: bytemuck::Pod>(
0,
staging_buffer,
0,
std::mem::size_of_val(output) as u64,
size_of_val(output) as u64,
);
queue.submit(Some(command_encoder.finish()));
let buffer_slice = staging_buffer.slice(..);