Additional api_logging for passes (#8326)

This commit is contained in:
Andy Leiserson authored and GitHub committed 2025-10-13 13:19:29 -04:00
1 parent 26b83e75ae
commit 3f7dae1a30
2 files changed
+26 -4

No files matched your search

+5 -1
View File
@@ -7,7 +7,7 @@ use wgt::{
use alloc::{borrow::Cow, boxed::Box, sync::Arc, vec::Vec};
use core::{convert::Infallible, fmt, str};
use crate::{binding_model::BindError, resource::RawResourceAccess};
use crate::{api_log, binding_model::BindError, resource::RawResourceAccess};
use crate::{
binding_model::{LateMinBufferBindingSizeMismatch, PushConstantUploadError},
command::{
@@ -853,6 +853,8 @@ fn set_pipeline(
}
fn dispatch(state: &mut State, groups: [u32; 3]) -> Result<(), ComputePassErrorInner> {
api_log!("ComputePass::dispatch {groups:?}");
state.is_ready()?;
state.flush_states(None)?;
@@ -888,6 +890,8 @@ fn dispatch_indirect(
buffer: Arc<Buffer>,
offset: u64,
) -> Result<(), ComputePassErrorInner> {
api_log!("ComputePass::dispatch_indirect");
buffer.same_device(device)?;
state.is_ready()?;
+21 -3
View File
@@ -948,20 +948,38 @@ impl CommandEncoder {
timestamp_writes,
occlusion_query_set,
} => {
encode_render_pass(
api_log!(
"Begin encoding render pass with '{}' label",
pass.label.as_deref().unwrap_or("")
);
let res = encode_render_pass(
&mut state,
pass,
color_attachments,
depth_stencil_attachment,
timestamp_writes,
occlusion_query_set,
)?;
);
match res.as_ref() {
Err(err) => api_log!("Finished encoding render pass ({err:?})"),
Ok(_) => api_log!("Finished encoding render pass (success)"),
}
res?;
}
ArcCommand::RunComputePass {
pass,
timestamp_writes,
} => {
encode_compute_pass(&mut state, pass, timestamp_writes)?;
api_log!(
"Begin encoding compute pass with '{}' label",
pass.label.as_deref().unwrap_or("")
);
let res = encode_compute_pass(&mut state, pass, timestamp_writes);
match res.as_ref() {
Err(err) => api_log!("Finished encoding compute pass ({err:?})"),
Ok(_) => api_log!("Finished encoding compute pass (success)"),
}
res?;
}
_ => unreachable!(),
}