Skip to content

Commit 2f282cd

Browse files
committed
remove instance_flags arg from StagingBuffer::new
1 parent 26f65dd commit 2f282cd

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

wgpu-core/src/device/queue.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ impl Global {
405405
// Platform validation requires that the staging buffer always be
406406
// freed, even if an error occurs. All paths from here must call
407407
// `device.pending_writes.consume`.
408-
let (staging_buffer, staging_buffer_ptr) =
409-
StagingBuffer::new(device, data_size, device.instance_flags)?;
408+
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(device, data_size)?;
410409
let mut pending_writes = device.pending_writes.lock();
411410
let pending_writes = pending_writes.as_mut().unwrap();
412411

@@ -449,8 +448,7 @@ impl Global {
449448

450449
let device = &queue.device;
451450

452-
let (staging_buffer, staging_buffer_ptr) =
453-
StagingBuffer::new(device, buffer_size, device.instance_flags)?;
451+
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(device, buffer_size)?;
454452

455453
let fid = hub.staging_buffers.prepare(id_in);
456454
let id = fid.assign(Arc::new(staging_buffer));
@@ -781,8 +779,7 @@ impl Global {
781779
// Platform validation requires that the staging buffer always be
782780
// freed, even if an error occurs. All paths from here must call
783781
// `device.pending_writes.consume`.
784-
let (staging_buffer, staging_buffer_ptr) =
785-
StagingBuffer::new(device, stage_size, device.instance_flags)?;
782+
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(device, stage_size)?;
786783

787784
if stage_bytes_per_row == bytes_per_row {
788785
profiling::scope!("copy aligned");

wgpu-core/src/device/resource.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -591,11 +591,8 @@ impl<A: HalApi> Device<A> {
591591
};
592592
hal::BufferUses::MAP_WRITE
593593
} else {
594-
let (staging_buffer, staging_buffer_ptr) = StagingBuffer::new(
595-
self,
596-
wgt::BufferSize::new(aligned_size).unwrap(),
597-
self.instance_flags,
598-
)?;
594+
let (staging_buffer, staging_buffer_ptr) =
595+
StagingBuffer::new(self, wgt::BufferSize::new(aligned_size).unwrap())?;
599596

600597
// Zero initialize memory and then mark the buffer as initialized
601598
// (it's guaranteed that this is the case by the time the buffer is usable)

wgpu-core/src/resource.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,12 +863,11 @@ impl<A: HalApi> StagingBuffer<A> {
863863
pub(crate) fn new(
864864
device: &Arc<Device<A>>,
865865
size: wgt::BufferSize,
866-
instance_flags: wgt::InstanceFlags,
867866
) -> Result<(Self, NonNull<u8>), DeviceError> {
868867
use hal::Device;
869868
profiling::scope!("StagingBuffer::new");
870869
let stage_desc = hal::BufferDescriptor {
871-
label: crate::hal_label(Some("(wgpu internal) Staging"), instance_flags),
870+
label: crate::hal_label(Some("(wgpu internal) Staging"), device.instance_flags),
872871
size: size.get(),
873872
usage: hal::BufferUses::MAP_WRITE | hal::BufferUses::COPY_SRC,
874873
memory_flags: hal::MemoryFlags::TRANSIENT,

0 commit comments

Comments
 (0)