diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 12f5b3083c..0465ee11d2 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -17,7 +17,7 @@ use crate::{ use hal::command::CommandBuffer as _; use wgt::{BufferAddress, BufferUsage, BIND_BUFFER_ALIGNMENT}; -use std::{iter, str}; +use std::{fmt, iter, str}; #[doc(hidden)] #[derive(Clone, Copy, Debug)] @@ -71,6 +71,18 @@ impl ComputePass { } } +impl fmt::Debug for ComputePass { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "ComputePass {{ encoder_id: {:?}, data: {:?} commands and {:?} dynamic offsets }}", + self.parent_id, + self.base.commands.len(), + self.base.dynamic_offsets.len() + ) + } +} + #[repr(C)] #[derive(Clone, Debug, Default)] pub struct ComputePassDescriptor { diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index ef0554b9ea..43a437d833 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -166,6 +166,20 @@ impl RenderPass { } } +impl fmt::Debug for RenderPass { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "RenderPass {{ encoder_id: {:?}, color_targets: {:?}, depth_stencil_target: {:?}, data: {:?} commands and {:?} dynamic offsets }}", + self.parent_id, + self.color_targets, + self.depth_stencil_target, + self.base.commands.len(), + self.base.dynamic_offsets.len() + ) + } +} + #[derive(Debug, PartialEq)] enum OptionalState { Unused,