diff --git a/crates/metal2vulkan-runtime/src/command_buffer/mod.rs b/crates/metal2vulkan-runtime/src/command_buffer/mod.rs index 669363226..2498e22d4 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/mod.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/mod.rs @@ -86,7 +86,7 @@ use super::heap_sets::HeapUse; use super::kept_commands::KeptContext; use super::live_buffers::LiveTable; use super::merge_scratch::MergeScratch; -use super::pass_runs::{PassRuns, RunPoint}; +use super::pass_runs::{PassRuns, RunKeep, RunPoint}; use super::pipeline::budget::Urgency; use super::pipeline::kept::StepNumbers; use super::predication::{Event, Predication}; @@ -98,7 +98,7 @@ use super::replay::Replay; use super::residency::Residency; use super::resource::{ObjectId, ResourceKey}; use super::scheduler::{BatchSync, Hand, StepWaits}; -use super::shadow::{ShadowCarry, ShadowCopy}; +use super::shadow::ShadowCarry; use super::spares::CommandPool; use super::sparse::encoder::SparseUpdate; use super::sparse::indirect; @@ -816,7 +816,7 @@ pub(super) struct State { pass_runs: PassRuns, /// The keeps the encoder being encoded again records after itself, where it leaves a run of /// passes another pass went on in (`pass_runs.rs`, `command_buffer/reencode.rs`). - pub(super) replaying_keeps: Vec, + pub(super) replaying_keeps: Vec, /// The pools of its commands' set 0 (`descriptor_arena.rs`), given back or released with /// the uploads. pub(super) descriptors: DescriptorArena, diff --git a/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs b/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs index 0157e3bc7..149bfb431 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs @@ -43,11 +43,12 @@ //! 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. -//! - **Runs of passes.** An encoder encoded again that was a pass of a run of passes over a -//! shadowed texture merged once (`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, and it keeps the -//! run's scratch after its own merge where a later pass went on over it (`State::replaying_keeps`, -//! recorded by `EncoderCore::finish_replay`). Its run's other passes are not encoded again. +//! - **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, +//! and it keeps the run's scratch after its own merge where a later pass went on over it, a +//! linear attachment's run's box copied in again first (`State::replaying_keeps`, recorded by +//! `EncoderCore::finish_replay`). Its run's other passes are not encoded again. //! - **What cannot be encoded again stays as before.** An encoder whose log is gone (a compute //! encoder of a command buffer that used command predication whose unit laid a step before it //! opened, or one of its own that the unit's later encoders read, or a loop, or left work out; diff --git a/crates/metal2vulkan-runtime/src/encoder.rs b/crates/metal2vulkan-runtime/src/encoder.rs index 2c3eb344c..d74d374e3 100644 --- a/crates/metal2vulkan-runtime/src/encoder.rs +++ b/crates/metal2vulkan-runtime/src/encoder.rs @@ -45,6 +45,7 @@ use super::index_rewrite::{ }; use super::kept_commands::{Held, KeptEffects}; use super::noted_apart::{NotedApart, NotedInto}; +use super::pass_runs::RunKeep; use super::pending_dispatch::PendingDispatch; use super::pipeline::VariantObjects; use super::rebind::{Holds, Taken}; @@ -2651,12 +2652,23 @@ impl EncoderCore { self.count_shadow_copies(&copies); self.shadow_copies(&copies); // A pass of a run that a later pass went on over keeps the run's scratch again, from the - // image it left, for that pass's run (`pass_runs.rs`); the encoding again clears them - // as it ends (`command_buffer/reencode.rs`). + // image it left (a shadowed texture's), or from its box copied in again (a linear + // attachment's), for that pass's run (`pass_runs.rs`); the encoding again clears them as + // it ends (`command_buffer/reencode.rs`). let keeps = (self.open.command_buffer.state().replaying_keeps).clone(); - if !keeps.is_empty() { - self.count_shadow_copies(&keeps); - self.shadow_copies(&keeps); + let mut shadow_keeps = Vec::new(); + for keep in keeps { + match keep { + RunKeep::Shadow(copy) => shadow_keeps.push(copy), + RunKeep::Linear(merge) => { + merge.record_reload(&mut self); + self.retain(merge); + } + } + } + if !shadow_keeps.is_empty() { + self.count_shadow_copies(&shadow_keeps); + self.shadow_copies(&shadow_keeps); } if self.uses.broke_hold() { return Err(internal("a held depth used but as its attachment")); diff --git a/crates/metal2vulkan-runtime/src/linear_merge.rs b/crates/metal2vulkan-runtime/src/linear_merge.rs index 888f22084..669f653b6 100644 --- a/crates/metal2vulkan-runtime/src/linear_merge.rs +++ b/crates/metal2vulkan-runtime/src/linear_merge.rs @@ -43,7 +43,9 @@ //! (`WorkCounts::linear_merge_scratches_made`, `linear_merge_scratches_reused`). //! - **Runs.** Passes over one attachment one after another, with nothing between them that may //! touch its bytes or the kept image, keep once and merge once, after the last -//! (`pass_runs.rs`): one copy in, keep and merge a run, not one a pass. +//! (`pass_runs.rs`): one copy in, keep and merge a run, not one a pass. A pass of a run that a +//! rebind encodes again alone copies the run's box in again and keeps it after its own merge, +//! for the run's later passes ([`LinearMerge::record_reload`]). //! //! - **Reloaded at a barrier.** A draw after a memory barrier inside the pass may read the //! surface's bytes (a sampled texture over them, a buffer): before the render pass instance that @@ -370,6 +372,34 @@ impl LinearMerge { self.lend(); } + /// Record in `core`'s command buffer, after a pass of the merge's run encoded again alone that + /// a later pass of the run went on over (`pass_runs.rs`'s **Encoded again**), the box's copy in + /// from the surface, whose bytes that pass's merge and the merge before it left holding what + /// every pass before wrote, and its keep, between barriers: the run's later passes render + /// over what Metal's would load, and its merge writes only what they change. Its uses are + /// that pass's own copy in's, keep's and merge's: the same images. + pub(super) fn record_reload(&self, core: &mut EncoderCore) { + core.barrier(Barrier::everything()); + core.command(vk::PipelineStageFlags2::COPY, &[], |device, raw| { + // SAFETY: the encoder's command buffer is recording outside a render pass; the copy's + // region lies in both images (the box, inside the render area), which rest in + // `GENERAL` with the transfer usage the copies in take, and which the merge's run + // retains until it completes. + unsafe { + device.cmd_copy_image( + raw, + self.surface, + vk::ImageLayout::GENERAL, + self.backing, + vk::ImageLayout::GENERAL, + &[self.copy_in], + ); + } + }); + self.record_keep(core); + core.device().shared().counts.linear_run_reloaded(); + } + /// Lend the scratch to the command buffer's later merges, once: the last command that /// touches it lies before every command recorded from here on (`merge_scratch.rs`). pub(super) fn lend(&self) { diff --git a/crates/metal2vulkan-runtime/src/merge_scratch.rs b/crates/metal2vulkan-runtime/src/merge_scratch.rs index 57b3a77d6..47ad16c7f 100644 --- a/crates/metal2vulkan-runtime/src/merge_scratch.rs +++ b/crates/metal2vulkan-runtime/src/merge_scratch.rs @@ -25,8 +25,9 @@ //! attachment's by its pass's fill and keep after the copy in, its reloads at the pass's //! barriers and its merge after the pass, all recorded at the pass's end into its encoder's //! `VkCommandBuffer`s or the segments it leaves between them, which go between them in -//! submission order (a run's, by its first pass's fill and keep and the merge its last pass -//! leaves, between which it is lent to none); a shadow's by its keeps and merges, which the +//! submission order (a run's, by its first pass's fill and keep, the merge its last pass +//! leaves, and the fill and keep of a pass of it a rebind encoded again alone, which lie +//! between those two, where it is lent to none); a shadow's by its keeps and merges, which the //! encoder records before its next command that touches the bytes another way, or as it //! ends (`shadow.rs`), or a run's by its first pass's keep and the merge its last pass //! leaves, between which it is lent to none (`pass_runs.rs`). diff --git a/crates/metal2vulkan-runtime/src/pass_runs.rs b/crates/metal2vulkan-runtime/src/pass_runs.rs index 75c674762..6f22564ff 100644 --- a/crates/metal2vulkan-runtime/src/pass_runs.rs +++ b/crates/metal2vulkan-runtime/src/pass_runs.rs @@ -75,19 +75,29 @@ //! laying, whose first instance does not record inline, that names neither the bytes' buffer //! nor its host range and touches nothing past its attachments (as above), whose other //! attachments lie over none of the bytes, and that renders over no rasterization-rate map. -//! A linear attachment's pass joins only where it is encoded again with every other pass of its -//! run alone: its commands name no buffer over host pages, which a rebind would move and encode -//! its encoder again for (`command_buffer/reencode.rs`), and none of its attachments lies over -//! host pages but the run's own bytes (an image in place over a no-copy buffer's pages, which -//! every pass of the run renders, so a rebind of them encodes the whole run again: **Encoded -//! again**); and it executes no render commands. A shadowed +//! A linear attachment's pass joins where none of its attachments lies over host pages but the +//! run's own bytes (an image in place over a no-copy buffer's pages, which every pass of the run +//! renders, so a rebind of them encodes the whole run again: **Encoded again**), and it executes +//! no render commands. Its commands may name buffers over host pages (a consumer's upload chunk +//! in its guest RAM, which its `setVertexBytes` and `setFragmentBytes` land in): a rebind of one +//! moves it and encodes that pass again alone (`command_buffer/reencode.rs`), which leaves its +//! run (**Encoded again**). A shadowed //! texture's: one loaded and stored as a color (no stand-in, no planes, no resolve), whose //! truth is a buffer's bytes it merges back into, laid out as one image's texels. Every other //! pass merges after itself, as before; an encoder encoded again changes no run. //! - **Encoded again.** A linear attachment's run over host pages is encoded again whole by a //! rebind of them: each of its passes leaves the run ([`RunMerge::leave`]) and, encoded again, //! copies in, keeps and merges after itself as a pass alone does, in order, so the bytes hold -//! what the passes before it wrote when it copies them in. A shadowed texture's run may hold +//! what the passes before it wrote when it copies them in. A pass of a linear attachment's run +//! whose commands named a buffer over host pages that a rebind moved is encoded again alone, +//! and leaves its run the same way: the merge it had taken over records after all, at the pass +//! before it, and, encoded again, it copies its own box in, keeps it and merges after itself. +//! Where a later pass of the run had taken its merge over, it then copies the run's box in +//! again from the surface, whose bytes those merges left holding what every pass before wrote, +//! and keeps it into the run's scratch ([`RunMerge::keep_after`], `LinearMerge::record_reload`, +//! `WorkCounts::linear_runs_reloaded`): the run's later passes render over what Metal's would +//! load (its box may reach past the pass's own, where the pass opened it over its whole render +//! area), and its merge writes only what they change. A shadowed texture's run may hold //! passes over host pages, which a rebind //! before the command buffer's first submission encodes again (`command_buffer/reencode.rs`): //! each pass whose commands named a buffer that moved, and no other. Such a pass leaves its @@ -170,25 +180,31 @@ impl RunMerge { } /// The keep its pass, encoded again, records after itself where a later pass of its run took - /// its merge over: of the image that pass went on over into the scratch its run's merge - /// compares (the module's **Encoded again**). `None` for a linear attachment's run, whose - /// passes are encoded again all together or not at all, and a merge no later pass took over. - pub(super) fn keep_after(&self) -> Option { - let RunWork::Shadow(copy) = &self.work else { + /// its merge over (the module's **Encoded again**): a shadowed texture's, of the image that + /// pass went on over into the scratch its run's merge compares; a linear attachment's, the + /// run's box copied in again from the surface and kept (`LinearMerge::record_reload`). + /// `None` for a merge no later pass took over. + pub(super) fn keep_after(&self) -> Option { + if !self.taken.load(Ordering::Acquire) { return None; - }; - let Step::Merge(merge) = ©.step else { - return None; - }; - self.taken.load(Ordering::Acquire).then(|| ShadowCopy { - copies: Arc::clone(©.copies), - step: Step::Keep(Arc::clone(merge)), - kept: false, - area: None, - cause: None, - moves: None, - clear: None, - }) + } + match &self.work { + RunWork::Linear(merge) => Some(RunKeep::Linear(Arc::clone(merge))), + RunWork::Shadow(copy) => { + let Step::Merge(merge) = ©.step else { + return None; + }; + Some(RunKeep::Shadow(ShadowCopy { + copies: Arc::clone(©.copies), + step: Step::Keep(Arc::clone(merge)), + kept: false, + area: None, + cause: None, + moves: None, + clear: None, + })) + } + } } /// The shadowed texture's merge it records, for the counters; `None` for a linear @@ -223,6 +239,17 @@ impl RunMerge { } } +/// The keep a run's pass encoded again records after itself, where a later pass of its run took +/// its merge over ([`RunMerge::keep_after`]). +#[derive(Clone)] +pub(super) enum RunKeep { + /// A linear attachment's run's merge, whose box is copied in again and kept + /// (`LinearMerge::record_reload`). + Linear(Arc), + /// A shadowed texture's keep, into the scratch its run's merge compares. + Shadow(ShadowCopy), +} + /// What a run's passes have in one: for a linear attachment, the image they render, and the /// surface's own image and its subresource (`(level, layer, layers)`); for a shadowed texture, /// its shadow's identity (`ShadowCopies::shadow_key`). diff --git a/crates/metal2vulkan-runtime/src/render.rs b/crates/metal2vulkan-runtime/src/render.rs index 14656746a..d59505890 100644 --- a/crates/metal2vulkan-runtime/src/render.rs +++ b/crates/metal2vulkan-runtime/src/render.rs @@ -4893,15 +4893,15 @@ impl RenderLowering { attach(&target.texture); } } - // A pass encoded again only with every other pass of its run: its commands name no - // buffer over host pages, which a rebind moves and encodes the pass again for - // (`command_buffer/reencode.rs`), nor does any of its attachments lie over host pages - // but the run's own bytes, which every pass of the run renders, so a rebind of them - // encodes the whole run again, each pass merging alone (`pass_runs.rs`'s **Encoded - // again**); outside a predicated loop's laying. + // None of its attachments lies over host pages but the run's own bytes, which every + // pass of the run renders, so a rebind of them encodes the whole run again, each pass + // merging alone; outside a predicated loop's laying. Its commands may name buffers + // over host pages (a consumer's upload chunk in its guest RAM, which its + // `setVertexBytes` lands in): a rebind of one encodes the pass again alone, which + // leaves its run and copies the run's box in again after itself + // (`command_buffer/reencode.rs`, `pass_runs.rs`'s **Encoded again**). let laying = core.command_buffer().state().predication_mut().laying(); let over_pages = |key: &ResourceKey| rebinds.host_range(*key).is_some(); - let once = !named.iter().any(over_pages) && !laying; let mut joining = Vec::new(); for &(index, c, own) in &merging { let bytes = own.own.texture.use_key(); @@ -4915,7 +4915,7 @@ impl RenderLowering { let others_over_pages = (attached.iter()).any(|(k, _)| *k != bytes && over_pages(k)); let joins = quiet - && once + && !laying && !others_over_pages && !inline && own.cause == Cause::Linear diff --git a/crates/metal2vulkan-runtime/src/tests/linear_runs.rs b/crates/metal2vulkan-runtime/src/tests/linear_runs.rs index f34caea8b..4d408cd49 100644 --- a/crates/metal2vulkan-runtime/src/tests/linear_runs.rs +++ b/crates/metal2vulkan-runtime/src/tests/linear_runs.rs @@ -689,3 +689,159 @@ fn passes_reading_host_pages_form_one_run() { ); drop((texture, buffer, chunk)); } + +/// The rectangles ([`drawn`]) of [`a_pass_of_a_run_encoded_again_alone_reloads_the_run`]'s +/// passes, and whether each reads them from the chunk over host pages the test rebinds. +const RELOADED: [(usize, bool); 6] = [ + (0, false), + (5, true), + (1, false), + (2, true), + (3, false), + (6, false), +]; + +/// Six passes over a target over a `Private` buffer (rows of 1024 bytes), the rule forced, behind +/// a wait for a shared event only the host signals: the first opens a run over its rectangle, the +/// second's reaches past it and opens one over the whole target (`pass_runs.rs`'s **A run**), +/// which the other four go on with. The second and the fourth read their rectangle and color +/// from a no-copy buffer over host pages, rebound over other pages holding the same bytes before +/// the signal: the rebind encodes those two again alone (`command_buffer/reencode.rs`), each +/// leaving its run, merging after itself and copying the run's box in again and keeping it for +/// the passes after it (`pass_runs.rs`'s **Encoded again**); the texels are those a private +/// texture holds after the same passes. Without the copy in again, the third pass would blend +/// over texels no copy in wrote, outside the second's rectangle. +#[test] +fn a_pass_of_a_run_encoded_again_alone_reloads_the_run() { + let (width, row) = (256, 1024); + let packed = width * TEXEL; + let chunk_bytes = (2 * CHUNK_STRIDE).next_multiple_of(64 << 10); + let (host, chunk_pages, moved_to) = ( + Host::new(row * H), + Host::new(chunk_bytes), + Host::new(chunk_bytes), + ); + let cache = Scratch::new("linear-runs-reloaded"); + let device = device(&cache.0); + let queue = device.new_command_queue().unwrap(); + let blending = blending(&device); + let usage = TextureUsage::RENDER_TARGET | TextureUsage::SHADER_READ; + let depth_usage = TextureUsage::RENDER_TARGET; + let depth = private_texture(&device, PixelFormat::Depth32Float, width, depth_usage); + // The chunk: the readers' rectangles and colors, one stride apart, in their order. + let mut data = vec![0u8; chunk_bytes as usize]; + let readers = RELOADED.iter().filter(|(_, reads)| *reads); + for (at, &(i, _)) in readers.enumerate() { + let (corners, rgba) = drawn(i); + let at = at * CHUNK_STRIDE as usize; + data[at..at + 16].copy_from_slice(&bytes_of(&corners, f32::to_le_bytes)); + data[at + 16..at + 32].copy_from_slice(&bytes_of(&rgba, f32::to_le_bytes)); + } + chunk_pages.write(&data); + moved_to.write(&data); + // SAFETY: the pages outlive the buffer, which alone uses them while it lives. + let made = unsafe { + device.new_buffer_with_bytes_no_copy( + chunk_pages.memory(), + chunk_bytes, + ResourceOptions::default(), + None, + ) + }; + let chunk = match made { + Ok(chunk) => chunk, + Err(crate::Error::Unsupported(gap)) => { + println!("LINEAR-RUNS reloaded: the device imports no host memory: {gap:?}"); + return; + } + Err(error) => panic!("new_buffer_with_bytes_no_copy: {error:?}"), + }; + // The passes over `texture`: from the chunk where they read it, else their own bytes. + let encode = |command_buffer: &CommandBuffer, texture: &Texture| { + let mut read = 0; + for &(i, reads) in &RELOADED { + if reads { + let at = read * CHUNK_STRIDE; + pass_from(command_buffer, (texture, &depth), &blending, (&chunk, at)); + read += 1; + } else { + pass(command_buffer, (texture, &depth), &blending, drawn(i), None); + } + } + }; + let reference = private_texture(&device, PixelFormat::RGBA8Unorm, width, usage); + let source = staged(&device, &first_bytes(width, packed)); + blit(&queue, |b| { + (b.copy_from_buffer_to_texture( + &source, + 0, + packed, + packed * H, + Size::new(width, H, 1), + &reference, + 0, + 0, + Origin::new(0, 0, 0), + BlitOption::None, + )) + .unwrap() + }); + let command_buffer = queue.command_buffer().unwrap(); + encode(&command_buffer, &reference); + command_buffer.commit().unwrap(); + command_buffer.wait_until_completed_for(WAIT).unwrap(); + assert_eq!(command_buffer.error(), None); + let left = texels_of(&queue, &reference); + let Some((buffer, texture)) = target(&queue, Over::Private, (width, row), &host) else { + return; + }; + assert!( + texture.linear_image().unwrap(), + "the target is a linear image" + ); + let gate = device.new_shared_event().unwrap(); + let forced = &device.shared().linear_rule_forced; + forced.store(true, Ordering::Relaxed); + let before = device.work_counts(); + let command_buffer = queue.command_buffer().unwrap(); + (command_buffer.encode_wait_for_event(EventRef::Shared(&gate), 1)).unwrap(); + encode(&command_buffer, &texture); + command_buffer.commit().unwrap(); + let encoded = device.work_counts(); + assert_eq!(chunk.detach_backing(), Ok(true), "the detach"); + // SAFETY: the pages outlive every buffer over them, which alone uses them while it lives. + unsafe { chunk.rebind_bytes_no_copy(moved_to.memory(), None, None) }.unwrap(); + let rebound = device.work_counts(); + gate.set_signaled_value(1); + command_buffer.wait_until_completed_for(WAIT).unwrap(); + let after = device.work_counts(); + forced.store(false, Ordering::Relaxed); + let delta = |of: fn(&WorkCounts) -> u64, (a, b): (&WorkCounts, &WorkCounts)| of(b) - of(a); + let first_taken = delta(|c| c.linear_merges_taken_over, (&before, &encoded)); + let again = delta(|c| c.encoders_reencoded, (&encoded, &rebound)); + let refused = delta(|c| c.reencodes_refused, (&encoded, &rebound)); + let reloaded = delta(|c| c.linear_runs_reloaded, (&encoded, &rebound)); + let recorded = delta(|c| c.linear_merges_recorded, (&before, &after)); + println!( + "LINEAR-RUNS reloaded on {}: {:?} {:?}; first encoding's merges taken over \ + {first_taken}; encoders encoded again {again}, refused {refused}, runs reloaded \ + {reloaded}; linear merges recorded {recorded}", + device.name(), + command_buffer.status(), + command_buffer.error(), + ); + assert_eq!(command_buffer.error(), None); + assert_eq!(first_taken, 4, "the passes form two runs as first encoded"); + assert_eq!( + (again, refused, reloaded), + (2, 0, 2), + "the rebind encodes the two readers again, each reloading its run" + ); + // The first run's, the two readers' own, the merge the fourth had taken over, and the + // second run's last. + assert_eq!(recorded, 5, "the merges recorded"); + let got = texels(&bytes(&queue, Over::Private, &buffer, row * H), width, row); + let differ = (0..got.len()).filter(|&i| got[i] != left[i]).count(); + assert_eq!(differ, 0, "the texels differ from the private texture's"); + drop((texture, buffer, chunk)); +} diff --git a/crates/metal2vulkan-runtime/src/work_counts.rs b/crates/metal2vulkan-runtime/src/work_counts.rs index 44957fe7b..daef77ad8 100644 --- a/crates/metal2vulkan-runtime/src/work_counts.rs +++ b/crates/metal2vulkan-runtime/src/work_counts.rs @@ -288,6 +288,7 @@ pub(crate) struct Counters { linear_merge_scratches_reused: AtomicU64, linear_merges_recorded: AtomicU64, linear_merges_taken_over: AtomicU64, + linear_runs_reloaded: AtomicU64, kept_bytes_passes: AtomicU64, kept_texels_passes: AtomicU64, color_group_passes: AtomicU64, @@ -2499,6 +2500,12 @@ impl Counters { .fetch_add(1, Ordering::Relaxed); } + /// A pass of a linear attachment's run, encoded again alone, copied its run's box in again + /// and kept it after itself (`pass_runs.rs`'s **Encoded again**). + pub(crate) fn linear_run_reloaded(&self) { + self.linear_runs_reloaded.fetch_add(1, Ordering::Relaxed); + } + /// A pass rendered a texture over a buffer it does not store through the image its texture /// keeps (`kept_bytes.rs`). pub(crate) fn kept_bytes_pass(&self) { @@ -5344,6 +5351,11 @@ pub struct WorkCounts { /// The merges a later pass of their run took over: none of them is recorded, and the run's /// last merge writes what they would have. pub linear_merges_taken_over: u64, + /// Passes of a linear attachment's run that a rebind encoded again alone (their commands + /// named a buffer over host pages it moved) and a later pass of the run went on over: each + /// copied the run's box in again from the surface after its own merge, and kept it, for the + /// run's later passes and its merge (`pass_runs.rs`'s **Encoded again**). + pub linear_runs_reloaded: u64, /// Passes that rendered a color attachment over a buffer's bytes, which they do not store /// (`DontCare`, `MultisampleResolve`), through the image its texture keeps, so that the buffer /// keeps its bytes (`kept_bytes.rs`). @@ -7007,6 +7019,7 @@ impl Device { .load(Ordering::Relaxed), linear_merges_recorded: counters.linear_merges_recorded.load(Ordering::Relaxed), linear_merges_taken_over: counters.linear_merges_taken_over.load(Ordering::Relaxed), + linear_runs_reloaded: counters.linear_runs_reloaded.load(Ordering::Relaxed), kept_bytes_passes: counters.kept_bytes_passes.load(Ordering::Relaxed), kept_texels_passes: counters.kept_texels_passes.load(Ordering::Relaxed), color_group_passes: counters.color_group_passes.load(Ordering::Relaxed), diff --git a/crates/metal2vulkan/tests/api_signatures.tsv b/crates/metal2vulkan/tests/api_signatures.tsv index 20ba007f1..1f57b2b58 100644 --- a/crates/metal2vulkan/tests/api_signatures.tsv +++ b/crates/metal2vulkan/tests/api_signatures.tsv @@ -2841,6 +2841,7 @@ field metal2vulkan-runtime::WorkCounts.linear_merges_recorded pub linear_merges_ field metal2vulkan-runtime::WorkCounts.linear_merges_taken_over pub linear_merges_taken_over: u64 field metal2vulkan-runtime::WorkCounts.linear_passes_in_place pub linear_passes_in_place: u64 field metal2vulkan-runtime::WorkCounts.linear_passes_through_copies pub linear_passes_through_copies: u64 +field metal2vulkan-runtime::WorkCounts.linear_runs_reloaded pub linear_runs_reloaded: u64 field metal2vulkan-runtime::WorkCounts.linked_pipelines_shared pub linked_pipelines_shared: u64 field metal2vulkan-runtime::WorkCounts.linked_use_questions_asked pub linked_use_questions_asked: u64 field metal2vulkan-runtime::WorkCounts.live_tables_uploaded pub live_tables_uploaded: u64