Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions crates/xcl/src/hle/d3d12x/cpu_writes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ fn worker() -> &'static Mutex<mpsc::Sender<Job>> {
for job in rx {
if job.fence.GetCompletedValue() < job.value && job.fence.SetEventOnCompletion(job.value, HANDLE(event as *mut c_void)).is_ok() {
th::WaitForSingleObject(event, WAIT_MS);
if job.fence.GetCompletedValue() < job.value {
static LATE: AtomicU64 = AtomicU64::new(0);
let k = LATE.fetch_add(1, Ordering::Relaxed) + 1;
if k.is_power_of_two() {
crate::xlog_warn!("D3D12.X: {k} writes after the GPU so far done although their queue had not got there after {WAIT_MS} ms (fence at {}, wanted {}; {} writes)", job.fence.GetCompletedValue(), job.value, job.writes.len());
}
}
}
for w in &job.writes {
match w {
Expand Down
8 changes: 8 additions & 0 deletions crates/xcl/src/hle/d3d12x/sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,16 @@ pub unsafe fn init(dev: &ID3D12Device) -> Vec<(usize, usize, u64)> {
let alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT)?;
let list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &alloc, None)?;
list.Close()?;
let _ = list.SetName(windows::core::w!("xcl sparse upload list"));
let _ = alloc.SetName(windows::core::w!("xcl sparse upload allocator"));
slots.push(UploadSlot { alloc, list, fence_val: 0 });
}
let rb_alloc: ID3D12CommandAllocator = dev.CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT)?;
let rb_list: ID3D12GraphicsCommandList = dev.CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, &rb_alloc, None)?;
rb_list.Close()?;
let _ = rb_list.SetName(windows::core::w!("xcl sparse readback list"));
let _ = rb_alloc.SetName(windows::core::w!("xcl sparse readback allocator"));
let _ = queue.SetName(windows::core::w!("xcl sparse queue"));
Ok(State {
dev: dev.clone(),
queue,
Expand Down Expand Up @@ -768,6 +773,9 @@ impl State {
}
let _ = self.fence.SetEventOnCompletion(target, self.event);
windows::Win32::System::Threading::WaitForSingleObject(self.event, 5000);
if self.fence.GetCompletedValue() < target {
crate::xlog_warn!("sparse: the queue has not reached fence value {target} after 5 s (at {})", self.fence.GetCompletedValue());
}
}

#[inline]
Expand Down
Loading