diff --git a/Cargo.lock b/Cargo.lock index 0d88b89915..6a93c95b1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2913,6 +2913,7 @@ dependencies = [ "parking_lot 0.12.1", "png", "pollster", + "profiling", "raw-window-handle 0.5.0", "serde", "smallvec", diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index dd65d77819..03a76edf93 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -389,6 +389,7 @@ impl Global { buffer_size: wgt::BufferSize, id_in: Input, ) -> Result<(id::StagingBufferId, *mut u8), QueueWriteError> { + profiling::scope!("Queue::create_staging_buffer"); let hub = A::hub(self); let root_token = &mut Token::root(); @@ -413,8 +414,7 @@ impl Global { buffer_offset: wgt::BufferAddress, staging_buffer_id: id::StagingBufferId, ) -> Result<(), QueueWriteError> { - profiling::scope!("Queue::write_buffer_with"); - + profiling::scope!("Queue::write_staging_buffer"); let hub = A::hub(self); let root_token = &mut Token::root(); @@ -457,6 +457,7 @@ impl Global { buffer_offset: u64, buffer_size: u64, ) -> Result<(), QueueWriteError> { + profiling::scope!("Queue::validate_write_buffer"); let hub = A::hub(self); let root_token = &mut Token::root(); diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index c5a02e7fdd..186202ea6c 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -151,6 +151,7 @@ optional = true arrayvec.workspace = true log.workspace = true parking_lot.workspace = true +profiling.workspace = true raw-window-handle.workspace = true serde = { workspace = true, features = ["derive"], optional = true } smallvec.workspace = true diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index aff3817c83..151972deff 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -3853,6 +3853,7 @@ impl Queue { offset: BufferAddress, size: BufferSize, ) -> Option> { + profiling::scope!("Queue::write_buffer_with"); DynContext::queue_validate_write_buffer( &*self.context, &self.id,