Skip to content
Open
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/list_x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,13 @@ unsafe fn try_split_for_wait(list: *mut c_void) -> Option<*mut c_void> {

/// Gives a dispatch whose pipeline is still being built a segment of its own, recorded at the submit.
pub(super) unsafe fn defer(list: *mut c_void, what: Deferred) -> bool {
// With bounded waits (`XCL_PSO_WAIT_MS`) the call is recorded now and its bind waits at most
// that long, as before calls were put off: a segment per unbuilt call ran a retail title out
// of command list memory (Close: E_OUTOFMEMORY, then the device was removed, 0x887a0001)
// when its world start bound thousands of them with `XCL_PSO_WAIT_MS=1`.
if super::pso_async::waits_bounded() {
return false;
}
if split(list, Some(what)).is_none() {
return false;
}
Expand Down
6 changes: 6 additions & 0 deletions crates/xcl/src/hle/d3d12x/pso_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,12 @@ fn wait_budget() -> Option<std::time::Duration> {
*B.get_or_init(|| std::env::var("XCL_PSO_WAIT_MS").ok().and_then(|v| v.trim().parse::<u64>().ok()).filter(|&ms| ms > 0).map(std::time::Duration::from_millis))
}

/// Binds wait at most `XCL_PSO_WAIT_MS`: a dispatch is then not put off to the submit
/// (`list_x::defer`), where it would only wait as long.
pub fn waits_bounded() -> bool {
wait_budget().is_some()
}

/// `resolve_wait` for at most `budget`: the build goes to the workers (not this thread), and a
/// pipeline not built by then is `late` – it and later binds of it get the stand-in (their
/// dispatches are skipped) until a worker has built it.
Expand Down
Loading