diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 515ca76e8..c5d321ad2 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -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, offset: u64, ) -> Result<(), ComputePassErrorInner> { + api_log!("ComputePass::dispatch_indirect"); + buffer.same_device(device)?; state.is_ready()?; diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index 934a5ae7a..26317bd4f 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -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!(), }