Remove unnecessary create_buffer_init
for uniforms
This commit is contained in:
parent
b689778ed9
commit
3eb63762c7
@ -78,16 +78,12 @@ impl Pipeline {
|
|||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
let uniforms = Uniforms {
|
let uniforms_buffer = device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
transform: Transformation::identity().into(),
|
label: None,
|
||||||
};
|
size: mem::size_of::<Uniforms>() as u64,
|
||||||
|
usage: wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST,
|
||||||
let uniforms_buffer =
|
mapped_at_creation: false,
|
||||||
device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
});
|
||||||
label: None,
|
|
||||||
contents: uniforms.as_bytes(),
|
|
||||||
usage: wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST,
|
|
||||||
});
|
|
||||||
|
|
||||||
let constant_bind_group =
|
let constant_bind_group =
|
||||||
device.create_bind_group(&wgpu::BindGroupDescriptor {
|
device.create_bind_group(&wgpu::BindGroupDescriptor {
|
||||||
|
@ -34,12 +34,12 @@ impl Pipeline {
|
|||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
|
|
||||||
let constants_buffer =
|
let constants_buffer = device.create_buffer(&wgpu::BufferDescriptor {
|
||||||
device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
|
label: None,
|
||||||
label: None,
|
size: mem::size_of::<Uniforms>() as u64,
|
||||||
contents: Uniforms::default().as_bytes(),
|
usage: wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST,
|
||||||
usage: wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST,
|
mapped_at_creation: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
let constants = device.create_bind_group(&wgpu::BindGroupDescriptor {
|
let constants = device.create_bind_group(&wgpu::BindGroupDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
|
Loading…
Reference in New Issue
Block a user