mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
remove instance_flags
arg from StagingBuffer::new
This commit is contained in:
parent
26f65ddffd
commit
2f282cdd06
@ -405,8 +405,7 @@ impl Global {
|
||||
// Platform validation requires that the staging buffer always be
|
||||
// freed, even if an error occurs. All paths from here must call
|
||||
// `device.pending_writes.consume`.
|
||||
let (staging_buffer, staging_buffer_ptr) =
|
||||
StagingBuffer::new(device, data_size, device.instance_flags)?;
|
||||
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(device, data_size)?;
|
||||
let mut pending_writes = device.pending_writes.lock();
|
||||
let pending_writes = pending_writes.as_mut().unwrap();
|
||||
|
||||
@ -449,8 +448,7 @@ impl Global {
|
||||
|
||||
let device = &queue.device;
|
||||
|
||||
let (staging_buffer, staging_buffer_ptr) =
|
||||
StagingBuffer::new(device, buffer_size, device.instance_flags)?;
|
||||
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(device, buffer_size)?;
|
||||
|
||||
let fid = hub.staging_buffers.prepare(id_in);
|
||||
let id = fid.assign(Arc::new(staging_buffer));
|
||||
@ -781,8 +779,7 @@ impl Global {
|
||||
// Platform validation requires that the staging buffer always be
|
||||
// freed, even if an error occurs. All paths from here must call
|
||||
// `device.pending_writes.consume`.
|
||||
let (staging_buffer, staging_buffer_ptr) =
|
||||
StagingBuffer::new(device, stage_size, device.instance_flags)?;
|
||||
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(device, stage_size)?;
|
||||
|
||||
if stage_bytes_per_row == bytes_per_row {
|
||||
profiling::scope!("copy aligned");
|
||||
|
@ -591,11 +591,8 @@ impl<A: HalApi> Device<A> {
|
||||
};
|
||||
hal::BufferUses::MAP_WRITE
|
||||
} else {
|
||||
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(
|
||||
self,
|
||||
wgt::BufferSize::new(aligned_size).unwrap(),
|
||||
self.instance_flags,
|
||||
)?;
|
||||
let (staging_buffer, staging_buffer_ptr) =
|
||||
StagingBuffer::new(self, wgt::BufferSize::new(aligned_size).unwrap())?;
|
||||
|
||||
// Zero initialize memory and then mark the buffer as initialized
|
||||
// (it's guaranteed that this is the case by the time the buffer is usable)
|
||||
|
@ -863,12 +863,11 @@ impl<A: HalApi> StagingBuffer<A> {
|
||||
pub(crate) fn new(
|
||||
device: &Arc<Device<A>>,
|
||||
size: wgt::BufferSize,
|
||||
instance_flags: wgt::InstanceFlags,
|
||||
) -> Result<(Self, NonNull<u8>), DeviceError> {
|
||||
use hal::Device;
|
||||
profiling::scope!("StagingBuffer::new");
|
||||
let stage_desc = hal::BufferDescriptor {
|
||||
label: crate::hal_label(Some("(wgpu internal) Staging"), instance_flags),
|
||||
label: crate::hal_label(Some("(wgpu internal) Staging"), device.instance_flags),
|
||||
size: size.get(),
|
||||
usage: hal::BufferUses::MAP_WRITE | hal::BufferUses::COPY_SRC,
|
||||
memory_flags: hal::MemoryFlags::TRANSIENT,
|
||||
|
Loading…
Reference in New Issue
Block a user