diff --git a/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs b/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs index 4d5473827..c828c877a 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs @@ -639,6 +639,7 @@ impl State { || segment.gpu_alone || segment.work.joins_a_run() || segment.work.recorded_by_an_encoding_again() + || segment.work.left_again_by_an_encoding_again() }) }; let unjudged = self.unjudged_parts(); @@ -667,9 +668,11 @@ impl State { /// not since they were made (which goes, the encoding again having recorded those draws, or /// left a segment of its own where it found them still being made), work its commit recorded /// on the GPU alone, a run's merge (which - /// goes, the encoding again merging after itself, `pass_runs.rs`), or a staged gather (which - /// goes, the encoding again copying through the imports, `host_ram/copy.rs`), or its group - /// was submitted, or the command buffer completed. + /// goes, the encoding again merging after itself, `pass_runs.rs`), a staged gather (which + /// goes, the encoding again copying through the imports, `host_ram/copy.rs`), or a splice's + /// or a merge on the host's CPU part (which goes, the encoding again leaving its own over the + /// new pages, `shadow_splice.rs`), or its group was submitted, or the command buffer + /// completed. pub(super) fn splice_replay( &mut self, at: usize, @@ -709,8 +712,9 @@ impl State { recorded.raws = raws; recorded.summary = summary; // Its first segments go: the encoding again left a segment of its own in each - // pending dispatch's place, and its work on the GPU alone in segments of its own, and - // recorded each staged gather's copy at once. + // pending dispatch's and each splice's or merge on the host's place, and its work on + // the GPU alone in segments of its own, and recorded each staged gather's copy at + // once. // What the commit recorded of one stays retained, never submitted, as the first // recording does. for segment in recorded.segments.drain(..) { diff --git a/crates/metal2vulkan-runtime/src/deferred.rs b/crates/metal2vulkan-runtime/src/deferred.rs index 9fa929632..6b4e2ced1 100644 --- a/crates/metal2vulkan-runtime/src/deferred.rs +++ b/crates/metal2vulkan-runtime/src/deferred.rs @@ -576,6 +576,15 @@ impl Deferred { } } + /// Whether a rebind's encoding again of its encoder leaves a segment of its own in its place + /// (`command_buffer/reencode.rs`): a splice's and a merge on the host's CPU part + /// (`shadow_splice.rs`), which the encoding again's copies back plan over the pages the + /// buffer lies in then and leave again, in a part as the first's (a rebind keeps the bytes' + /// offset in their page, `rebind.rs`, so the copies cut alike); the first's goes unrun. + pub(super) fn left_again_by_an_encoding_again(&self) -> bool { + matches!(self, Deferred::ShadowSplice(_)) + } + /// Whether a commit may record it on the GPU alone, for good /// ([`record_on_gpu`](Self::record_on_gpu)): an execution's, or a render pass's that executes /// render commands. diff --git a/crates/metal2vulkan-runtime/src/encoder.rs b/crates/metal2vulkan-runtime/src/encoder.rs index dde4b8aab..885aaef6e 100644 --- a/crates/metal2vulkan-runtime/src/encoder.rs +++ b/crates/metal2vulkan-runtime/src/encoder.rs @@ -310,14 +310,17 @@ impl Segment { /// pipelines were being made ([`pends`](Self::pends)), left as a segment again, work a /// commit may record on the GPU alone, recorded there again (`Deferred::record_on_gpu`), or a /// run's pass's merge, which the pass encoded again records after itself as a pass alone - /// does, leaving its run (`pass_runs.rs`), or a staged gather, which the encoding again - /// copies through the imports in its place (`Deferred::recorded_by_an_encoding_again`). Its - /// log is kept only where every segment does. + /// does, leaving its run (`pass_runs.rs`), a staged gather, which the encoding again + /// copies through the imports in its place (`Deferred::recorded_by_an_encoding_again`), or a + /// splice's or a merge on the host's CPU part, which the encoding again leaves again over the + /// new pages (`Deferred::left_again_by_an_encoding_again`). Its log is kept only where every + /// segment does. pub(super) fn records_again(&self) -> bool { self.pends() || self.work.may_run_on_gpu_alone() || self.work.joins_a_run() || self.work.recorded_by_an_encoding_again() + || self.work.left_again_by_an_encoding_again() } /// What its recording will use, on `device`, while `commit` left it to the host step for the diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index f7cce6f74..6f1f64f7c 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -94,7 +94,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 523; /// changes no behaviour, and then updates that hash alone with the commit saying why, or changes /// behaviour and also bumps this version. The commit that bumps it says what changed; this comment /// keeps no history. -pub const RUNTIME_VERSION: u32 = 2434; +pub const RUNTIME_VERSION: u32 = 2435; /// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex, /// of the manifest, the build script, and exactly the files the crate roots' module tree compiles