From eed1670036475ea86595ef5e5837a6ca4d5391bf Mon Sep 17 00:00:00 2001 From: Marvis Date: Wed, 25 Nov 2026 04:27:29 +0100 Subject: [PATCH] GPU: a listed frame's trace shows the title's barrier calls Diagnostics only. The trace of a listed frame named every command but not the barriers between them, so whether the title orders two dependent dispatches could not be read from it. Each barrier call now notes itself in its list: the enhanced form as its groups' (kind, count) pairs (0 global, 1 texture, 2 buffer), the legacy form as its barriers' kinds. Co-Authored-By: Claude Opus 5.5 --- crates/victory-gpu/src/list.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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.