Skip to content

Commit

Permalink
refactor: fully qual. size_of usage (#6401)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler authored Oct 12, 2024
1 parent 91447ae commit 2b15a2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions examples/src/bunnymark/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bytemuck::{Pod, Zeroable};
use nanorand::{Rng, WyRand};
use std::{borrow::Cow, mem};
use std::{borrow::Cow, mem::size_of};
use wgpu::util::DeviceExt;
use winit::{
event::{ElementState, KeyEvent},
Expand Down Expand Up @@ -164,7 +164,7 @@ impl crate::framework::Example for Example {
ty: wgpu::BindingType::Buffer {
ty: wgpu::BufferBindingType::Uniform,
has_dynamic_offset: false,
min_binding_size: wgpu::BufferSize::new(mem::size_of::<Globals>() as _),
min_binding_size: wgpu::BufferSize::new(size_of::<Globals>() as _),
},
count: None,
},
Expand Down Expand Up @@ -195,7 +195,7 @@ impl crate::framework::Example for Example {
ty: wgpu::BindingType::Buffer {
ty: wgpu::BufferBindingType::Uniform,
has_dynamic_offset: true,
min_binding_size: wgpu::BufferSize::new(mem::size_of::<Bunny>() as _),
min_binding_size: wgpu::BufferSize::new(size_of::<Bunny>() as _),
},
count: None,
}],
Expand Down Expand Up @@ -337,7 +337,7 @@ impl crate::framework::Example for Example {
resource: wgpu::BindingResource::Buffer(wgpu::BufferBinding {
buffer: &local_buffer,
offset: 0,
size: wgpu::BufferSize::new(mem::size_of::<Bunny>() as _),
size: wgpu::BufferSize::new(size_of::<Bunny>() as _),
}),
}],
label: None,
Expand Down
4 changes: 2 additions & 2 deletions examples/src/srgb_blend/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bytemuck::{Pod, Zeroable};
use std::mem;
use std::mem::size_of;
use wgpu::util::DeviceExt;

#[repr(C)]
Expand Down Expand Up @@ -70,7 +70,7 @@ impl<const SRGB: bool> crate::framework::Example for Example<SRGB> {
_queue: &wgpu::Queue,
) -> Self {
// Create the vertex and index buffers
let vertex_size = mem::size_of::<Vertex>();
let vertex_size = size_of::<Vertex>();
let (vertex_data, index_data) = create_vertices();

let vertex_buf = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
Expand Down

0 comments on commit 2b15a2b

Please sign in to comment.