Skip to content
Draft
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
39 changes: 39 additions & 0 deletions crates/xcl/src/hle/d3d12x/sparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,45 @@ impl WorkClaimLedger {
}
}

/// Point-in-time identities needed to prove that planning and a later serialized upload commit
/// still refer to the same sparse page. `source` names the observed CPU page by chunk hash rather
/// than retaining a raw pointer across the unlocked interval. Title writes are outside sparse
/// state/upload exclusion, so a future commit must own or revalidate the bytes it actually copies.
#[derive(Clone, Debug, Eq, PartialEq)]
#[allow(dead_code)]
struct UploadPageObservation {
page: usize,
pool: (u32, u32),
hole: bool,
sent: Option<[u64; CHUNKS]>,
source: [u64; CHUNKS],
}

#[derive(Clone, Debug, Eq, PartialEq)]
#[allow(dead_code)]
struct PlannedUploadPage {
page: usize,
tile: usize,
pool: (u32, u32),
reasons: WorkReasons,
zero: bool,
dirty: bool,
dirty_ranges: Vec<(usize, usize)>,
sent: Option<[u64; CHUNKS]>,
source: [u64; CHUNKS],
}

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[allow(dead_code)]
enum UploadPlanInvalid {
StateGeneration,
MappingEpoch,
MissingPage,
Mapping,
SentHashes,
SourceHashes,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(super) enum PreparationOutcome {
Ready,
Expand Down
Loading