diff --git a/crates/victory-gpu/src/list.rs b/crates/victory-gpu/src/list.rs index 80bc2ba..75c383f 100644 --- a/crates/victory-gpu/src/list.rs +++ b/crates/victory-gpu/src/list.rs @@ -372,6 +372,8 @@ extern "system" fn barrier(this: This, count: u32, barriers: *const Barrier) -> { // SAFETY: the title passes `count` barriers. let barriers = unsafe { std::slice::from_raw_parts(barriers, count as usize) }; + #[cfg(feature = "diagnostics")] + list.note_op(|| format!("barrier kinds {:?}", barriers.iter().map(|b| b.kind).collect::>())); let mut host: Vec = barriers .iter() .filter_map(|b| host_barrier(list, b)) @@ -1499,6 +1501,13 @@ extern "system" fn barrier_groups(this: This, count: u32, _groups: *const u8) { && let Some(list) = host_list(this) { use windows::Win32::Graphics::Direct3D12::D3D12_RESOURCE_BARRIER; + // Which kinds of barriers (0 global, 1 texture, 2 buffer) and how many. + #[cfg(feature = "diagnostics")] + if !_groups.is_null() { + // SAFETY: the title passes `count` groups of 16 bytes: kind, count, pointer. + let groups = unsafe { std::slice::from_raw_parts(_groups.cast::<[u32; 4]>(), count as usize) }; + list.note_op(|| format!("barrier groups {:?}", groups.iter().map(|g| (g[0], g[1])).collect::>())); + } // SAFETY: the same layout; no resource named. let barrier = unsafe { std::mem::transmute::(UAV_BARRIER) }; // SAFETY: an open list.