Improve write_buffer_with Spans (#3383)

This commit is contained in:
Connor Fitzgerald
2023-01-15 03:11:14 -05:00
committed by GitHub
parent f40611fd5c
commit 2ecced0c88
4 changed files with 6 additions and 2 deletions

1
Cargo.lock generated
View File

@@ -2913,6 +2913,7 @@ dependencies = [
"parking_lot 0.12.1",
"png",
"pollster",
"profiling",
"raw-window-handle 0.5.0",
"serde",
"smallvec",

View File

@@ -389,6 +389,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
buffer_size: wgt::BufferSize,
id_in: Input<G, id::StagingBufferId>,
) -> 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<G: GlobalIdentityHandlerFactory> Global<G> {
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<G: GlobalIdentityHandlerFactory> Global<G> {
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();

View File

@@ -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

View File

@@ -3853,6 +3853,7 @@ impl Queue {
offset: BufferAddress,
size: BufferSize,
) -> Option<QueueWriteBufferView<'a>> {
profiling::scope!("Queue::write_buffer_with");
DynContext::queue_validate_write_buffer(
&*self.context,
&self.id,