mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 14:23:32 +00:00
refactor: fully qual. size_of
usage (#6401)
This commit is contained in:
parent
91447aefc9
commit
2b15a2b24b
@ -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},
|
||||
@ -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,
|
||||
},
|
||||
@ -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,
|
||||
}],
|
||||
@ -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,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use bytemuck::{Pod, Zeroable};
|
||||
use std::mem;
|
||||
use std::mem::size_of;
|
||||
use wgpu::util::DeviceExt;
|
||||
|
||||
#[repr(C)]
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user