Merge VIctory-7900XTX (0a43566) with RTX 5090 fidelity & 32 GB RAM optimizations: two-plane compose, fallback heaps, TablePlan, residency guard, 256 MiB DirectStorage, and WaitOnAddress fence wakes
This commit is contained in:
1 parent
aebe5a0622
commit
f5847e6248
13 files changed
+974
-129
No files matched your search
@@ -115,7 +115,32 @@ extern "system" fn set_event_on_completion(this: This, value: u64, event: *mut c
|
||||
if fence.value.load(Ordering::Acquire) >= value {
|
||||
return S_OK;
|
||||
}
|
||||
tracing::warn!(value, "blocking fence wait not implemented");
|
||||
let deadline = std::time::Instant::now() + std::time::Duration::from_millis(250);
|
||||
loop {
|
||||
let current = fence.value.load(Ordering::Acquire);
|
||||
if current >= value {
|
||||
return S_OK;
|
||||
}
|
||||
let now = std::time::Instant::now();
|
||||
if now >= deadline {
|
||||
break;
|
||||
}
|
||||
let ms = (deadline - now).as_millis().min(10) as u32;
|
||||
// SAFETY: wait on the atomic u64 until woken by WakeByAddressAll or timeout.
|
||||
unsafe {
|
||||
windows_sys::Win32::System::Threading::WaitOnAddress(
|
||||
(&raw const fence.value).cast(),
|
||||
(&raw const current).cast(),
|
||||
size_of::<u64>(),
|
||||
ms.max(1),
|
||||
);
|
||||
}
|
||||
crate::queue::release_held(false);
|
||||
}
|
||||
if fence.value.load(Ordering::Acquire) >= value {
|
||||
return S_OK;
|
||||
}
|
||||
tracing::warn!(value, "blocking fence wait timed out");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
// shortcut: a null event means "block until reached"; nothing can
|
||||
@@ -140,6 +165,12 @@ pub(crate) fn set(this: This, value: u64) {
|
||||
}
|
||||
!reached
|
||||
});
|
||||
drop(waiters);
|
||||
#[cfg(windows)]
|
||||
// SAFETY: wake any guest thread polling/blocking via WaitOnAddress on the fence's GPU VA.
|
||||
unsafe {
|
||||
windows_sys::Win32::System::Threading::WakeByAddressAll((&raw const fence.value).cast());
|
||||
}
|
||||
}
|
||||
pub(crate) extern "system" fn signal(this: This, value: u64) -> HRESULT {
|
||||
let _called = crate::timeline::span("a fence set");
|
||||
|
||||
Reference in new issue
Block a user