Runtime: an encoder encoded again takes a tiled texture's copy where its first encoding took it
A tiled texture of more than one level over a buffer is a copy of the bytes taken at use: the first use encoded after its making, a did_modify_data or a level-0 replace_region clears the texture's mark and records the copy in and the later levels. A rebind of a no-copy buffer (or heap) the encoder also named, before its command buffer's first submission, encodes the encoder again and puts that recording in place of the first, which is never submitted. The encoding again found the mark already cleared, recorded no copy, and the texture's levels kept zeros or an older copy for good; a did_modify_data made after the commit was cleared by the encoding again instead of the next use. The decision now belongs to the encoding. ShadowSync notes, in order, what each first use of a copy taken at use decided (shadow::Takes); the ended encoder's record keeps that with its log, and the core an encoding again records into (EncoderCore::replaying, fed by reencode.rs through State::replaying_takes) takes each copy where the use in its place took it, never touching the mark. Its forget gives nothing back to the mark either. Other per-encoding state checked for the same shape: the shadow carry (an encoding again starts with none and copies the truth in, which earlier encoders copied back to as they ended; drops-writes shadows are never carried), gated copy-ins and standings (decided at batch submission, which sees the recording put in place), heap tiled and multisample sample moves (planned per recording, no mark), and segments recorded again on the GPU alone or at a host step (their shadow copies were planned by the encoder, not decided again). None consumes a mark at encoding. Verified at the parent (66b00df138), lavapipe, jobs m3-max-16324/16333: all four tiled_texture_reencode tests fail (levels read zero through the encoding again; the next use after a did_modify_data took nothing). The new CPU unit test in tests/shadow.rs covers the decisions directly. Runs of this commit follow in the report.
This commit is contained in:
1 parent
a25a9d8170
commit
eddd9112aa
7 files changed
+168
-17
No files matched your search
@@ -43,6 +43,11 @@
|
||||
//! its host step needs. Work a host step recorded again since (with the barriers between its
|
||||
//! commands, `gpu_execute::Rerecord`, or as a route outgrew it, `DeferredPass::outgrown`)
|
||||
//! keeps that step's recording.
|
||||
//! - **Copies taken at use.** A tiled texture's copy of its bytes taken at use (`shadow.rs`) is
|
||||
//! taken by the first use encoded after its mark was set, which clears it. An encoder encoded
|
||||
//! again takes it where the use in its place in its first encoding took it, whose recording is
|
||||
//! never submitted, and leaves the mark as it finds it: set by a `did_modify_data` since, it is
|
||||
//! the next use's to take (`shadow::Takes`).
|
||||
//! - **Runs of passes.** An encoder encoded again that was a pass of a run of passes merged once
|
||||
//! (a shadowed texture's or a linear attachment's, `pass_runs.rs`) leaves the run once it is
|
||||
//! put in place: the merge of the run's pass before it, which it took over, records after all,
|
||||
@@ -161,10 +166,17 @@ impl CommandBufferShared {
|
||||
})
|
||||
.collect();
|
||||
state.replaying_keeps = runs.iter().filter_map(|run| run.keep_after()).collect();
|
||||
// Its first encoding's takes of copies taken at use, taken again where they were:
|
||||
// that encoding's recording is never submitted (`shadow::Takes`).
|
||||
state.replaying_takes = state.ended[at].takes.clone();
|
||||
(state.residency_before(at, replay.kind()), runs)
|
||||
};
|
||||
let run = replay.run(&handle, residency);
|
||||
lock(&self.state).replaying_keeps.clear();
|
||||
{
|
||||
let mut state = lock(&self.state);
|
||||
state.replaying_keeps.clear();
|
||||
state.replaying_takes.clear();
|
||||
}
|
||||
// Its steps' gates listed as the commit lists the first encoding's.
|
||||
let run = {
|
||||
let mut state = lock(&self.state);
|
||||
|
||||
Reference in new issue
Block a user