Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions crates/xcl/src/hle/d3d12x/bind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,25 @@ fn put_in(list: *mut c_void, gfx: bool, i: u32, offset: u32, bytes: &[u8]) {
return;
};
let write_end = end.min(limit);
// (once 8 shapes are logged, an overrun does not take the lock)
static FULL: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
if end > limit && !FULL.load(std::sync::atomic::Ordering::Relaxed) {
// one line per distinct shape, 8 shapes at most
static SEEN: std::sync::Mutex<Vec<(bool, u32, u32, usize, usize, usize)>> = std::sync::Mutex::new(Vec::new());
let shape = (gfx, i, offset, bytes.len() / 4, write_end.saturating_sub(at) / 4, args.len() / 4);
let mut seen = SEEN.lock().unwrap_or_else(|e| e.into_inner());
if seen.len() < 8 && !seen.contains(&shape) {
seen.push(shape);
FULL.store(seen.len() >= 8, std::sync::atomic::Ordering::Relaxed);
crate::xlog_warn!(
"D3D12.X: root argument write past its parameter: {} parameter {i} offset {offset} dwords: {} dwords written, {} fit; table {} dwords",
if gfx { "graphics" } else { "compute" },
shape.3,
shape.4,
shape.5
);
}
}
if write_end > at {
if let Some(t) = args.get_mut(at..write_end) {
t.copy_from_slice(&bytes[..write_end - at]);
Expand Down
Loading