diff --git a/crates/metal2vulkan-runtime/src/buffer.rs b/crates/metal2vulkan-runtime/src/buffer.rs index f9384c218..137f7bae3 100644 --- a/crates/metal2vulkan-runtime/src/buffer.rs +++ b/crates/metal2vulkan-runtime/src/buffer.rs @@ -39,6 +39,7 @@ use super::host_memory::{HeldBack, HostParts, KeepAlive, Release}; use super::host_ram::RamOnDevice; #[cfg(unix)] use super::host_residency::{Again, Residency}; +use super::in_place::PendingMove; use super::managed_copy::{CallerCopy, SyncTarget}; use super::memory::{ BoundMemory, Holds, Mapped, MemoryClass, Placement, BLOCK_BYTES, FD_BLOCKS_HANDLE, @@ -50,6 +51,7 @@ use super::recycle::{self, BufferMaking}; use super::resource::{Identity, ObjectId, ResourceKey}; use super::retained::HeldBy; use super::texture::first_move::{Filled, Mine}; +use super::texture_spans::{LoneShadow, TextureSpans}; use super::values::{CpuCacheMode, HazardTrackingMode, ResourceOptions, StorageMode}; use super::Device; use crate::release; @@ -127,6 +129,9 @@ struct BufferShared { carried: AtomicBool, /// The calls outside a command buffer's work under way on these parts ([`Buffer::held_parts`]). calls: Mutex, + /// The bytes textures were made over, and the shadows of their linear cost that wait for + /// another texture over theirs (`texture_spans.rs`). + texture_spans: Mutex, } /// Where a buffer's bytes are. @@ -3352,6 +3357,7 @@ impl Device { next: OnceLock::new(), carried: AtomicBool::new(false), calls: Mutex::default(), + texture_spans: Mutex::default(), })) } @@ -3606,6 +3612,7 @@ impl Heap { next: OnceLock::new(), carried: AtomicBool::new(false), calls: Mutex::default(), + texture_spans: Mutex::default(), })) } } @@ -3926,6 +3933,28 @@ impl Buffer { } } + /// Whether a texture was made over any of its `bytes` (`texture_spans.rs`). + pub(super) fn textures_made_over(&self, bytes: &Range) -> bool { + lock(&self.s().texture_spans).made_over(bytes) + } + + /// Note a texture made over its `bytes`: the shadows of their linear cost that waited for + /// another texture over them, which the caller moves (`texture_spans.rs`). + pub(super) fn note_texture_made(&self, bytes: Range) -> Vec { + lock(&self.s().texture_spans).note(bytes) + } + + /// `texture`, a shadow of its linear cost over its `bytes` that no other texture was made + /// over, waits for one, to move in place with `pending` (`texture_spans.rs`). + pub(super) fn wait_for_texture_over( + &self, + bytes: Range, + texture: Weak, + pending: PendingMove, + ) { + lock(&self.s().texture_spans).wait(bytes, texture, pending); + } + /// Note, as it is made, that its maker declared the bytes between a texture's rows and slices /// over it unobserved (`BufferDescriptor::padding_unobserved`). pub(super) fn declare_padding_unobserved(&self) { @@ -4994,6 +5023,7 @@ impl Buffer { next: OnceLock::new(), carried: AtomicBool::new(false), calls: Mutex::default(), + texture_spans: Mutex::default(), })); // A two-copy buffer's device copy takes the pages' bytes, its GPU writes not synchronized // lost with the `VkDevice` (`managed_copy.rs`). diff --git a/crates/metal2vulkan-runtime/src/in_place.rs b/crates/metal2vulkan-runtime/src/in_place.rs index 856ca63ab..2567a3db5 100644 --- a/crates/metal2vulkan-runtime/src/in_place.rs +++ b/crates/metal2vulkan-runtime/src/in_place.rs @@ -644,8 +644,9 @@ pub(crate) enum ShadowCause { Refused(Refusal, String), /// Over the runtime's pooled memory ([`PagesClass::Pooled`]) that only the runtime's /// commands write (a tracked texture's over a `Private` buffer), its rows to their pitch take - /// this many bytes, past [`POOLED_PITCHED_BYTES`]: a `DRM_FORMAT_MOD_LINEAR` image of them - /// renders and samples slower than the shadow's own image with its copies. + /// this many bytes, past [`POOLED_PITCHED_BYTES`], and no other texture was made over its + /// bytes (`texture_spans.rs`): a `DRM_FORMAT_MOD_LINEAR` image of them renders and samples + /// slower than the shadow's own image with its copies. LinearCost(u64), } @@ -683,6 +684,16 @@ pub(crate) enum ShadowCause { /// 237.7/216.2, 404.4/409.4 and 2028.1/2433.2. A Radeon 780M (RADV) makes no such image at a pitch /// off a multiple of 256 bytes, at which its own linear image lays rows, so no texture there takes /// one. The same bound on every device. +/// +/// The bound weighs one texture over the bytes. Past it, each texture over the same bytes would be +/// a shadow of its own: an image of its own, copied in whole at its first use, and copied in whole +/// again after a write through any other texture over the bytes, which lets go of its standing, +/// and copied back whole after a kernel's write. So a texture over bytes another texture was made +/// over takes the image at any size (`texture_spans.rs`), and the first texture's shadow moves to +/// its image once another texture is made over its bytes. Measured with a guest's surface, 36 +/// textures (25 `BGRA8Unorm`, 11 `R32Uint`) of 6016x6016 at rows of 24,576 bytes over one +/// `Private` buffer, a kernel writing a 1024-texel square of two of them and reading a 256-texel +/// square of four others each frame (`runtime_lane::aliased_surfaces::aliased_surface_costs`). pub(crate) const POOLED_PITCHED_BYTES: u64 = 48 << 10; /// Why the device makes no image in place over a texture's texels. @@ -775,7 +786,8 @@ impl ShadowCause { ShadowCause::LinearCost(bytes) => format!( "its rows take {bytes} bytes to their pitch, past the {POOLED_PITCHED_BYTES} past \ which a DRM_FORMAT_MOD_LINEAR image at Metal's pitch renders and samples slower \ - than the shadow's own image with its copies" + than the shadow's own image with its copies, and no other texture was made over \ + its bytes" ), } } diff --git a/crates/metal2vulkan-runtime/src/lib.rs b/crates/metal2vulkan-runtime/src/lib.rs index 35770c351..4c430f57d 100644 --- a/crates/metal2vulkan-runtime/src/lib.rs +++ b/crates/metal2vulkan-runtime/src/lib.rs @@ -242,6 +242,7 @@ mod tessellation; mod texture; mod texture_descriptor; mod texture_placement; +mod texture_spans; mod this_thread; mod tile_pass; mod tracker; diff --git a/crates/metal2vulkan-runtime/src/tests/mod.rs b/crates/metal2vulkan-runtime/src/tests/mod.rs index a000e70a3..13d40066f 100644 --- a/crates/metal2vulkan-runtime/src/tests/mod.rs +++ b/crates/metal2vulkan-runtime/src/tests/mod.rs @@ -591,6 +591,7 @@ mod texture_placement; mod texture_placement_device; #[cfg(any(m2v_gpu, m2v_cpu_icd))] mod texture_resource_options; +mod texture_spans; mod this_thread; #[cfg(any(m2v_gpu, m2v_cpu_icd))] mod tile_pending; diff --git a/crates/metal2vulkan-runtime/src/tests/texture_spans.rs b/crates/metal2vulkan-runtime/src/tests/texture_spans.rs new file mode 100644 index 000000000..4dbf1a498 --- /dev/null +++ b/crates/metal2vulkan-runtime/src/tests/texture_spans.rs @@ -0,0 +1,43 @@ +//! The runs of a buffer's bytes that textures were made over (`texture_spans.rs`), which the +//! pooled bound reads: a texture made over bytes no run holds is the first over them, one made +//! over bytes a run holds is not, whether or not the textures noted there still live; runs that +//! meet join, and past the most runs kept a new one joins the nearest, which errs toward holding +//! bytes no texture was made over. + +use crate::texture_spans::TextureSpans; + +#[test] +fn bytes_a_texture_was_made_over_stay_noted() { + let mut spans = TextureSpans::default(); + assert!(!spans.made_over(&(0..100)), "no texture yet"); + assert!(spans.note(0..100).is_empty(), "no shadow waited"); + assert!(spans.made_over(&(0..100)), "the same bytes"); + assert!(spans.made_over(&(99..200)), "bytes that meet them"); + assert!(!spans.made_over(&(100..200)), "the bytes after them"); + // A second texture over bytes apart from the first's, then one over both: one run. + spans.note(300..400); + assert!(!spans.made_over(&(100..300)), "the bytes between two runs"); + spans.note(50..350); + assert!(spans.made_over(&(100..300)), "the joined run"); + assert!(!spans.made_over(&(400..500)), "past every run"); +} + +#[test] +fn past_the_most_runs_a_new_run_joins_the_nearest() { + let mut spans = TextureSpans::default(); + // Runs 1000 bytes apart, more of them than are kept apart. + for n in 0..20u64 { + spans.note(n * 1000..n * 1000 + 10); + } + for n in 0..20u64 { + assert!( + spans.made_over(&(n * 1000..n * 1000 + 10)), + "every texture's bytes stay noted ({n})" + ); + } + // Some gap between runs is now held: the runs err toward the image in place. + let held_gaps = (0..19u64) + .filter(|n| spans.made_over(&(n * 1000 + 10..n * 1000 + 1000))) + .count(); + assert!(held_gaps > 0, "joined runs hold a gap"); +} diff --git a/crates/metal2vulkan-runtime/src/texture.rs b/crates/metal2vulkan-runtime/src/texture.rs index 555614768..fcc53b497 100644 --- a/crates/metal2vulkan-runtime/src/texture.rs +++ b/crates/metal2vulkan-runtime/src/texture.rs @@ -546,6 +546,15 @@ impl TextureShared { } } +/// What a shadow over a buffer's bytes waits for to move in place +/// (`Device::storage_over_buffer`), with what it moves with. +enum MoveAfter { + /// Its class's in-place verdicts, made before them (`texture/storage_form.rs`). + Verdicts(in_place::PendingMove), + /// Another texture made over its bytes: a shadow of its linear cost (`texture_spans.rs`). + Aliases(in_place::PendingMove), +} + /// What holds a texture's texels; a view's are its texture's (the `Arc`s cloned). #[derive(Clone)] enum Storage { @@ -2418,13 +2427,22 @@ impl Device { ) -> Result { let record = ViewRecord::of_descriptor(layout, descriptor); let mut pending = None; - let over = (Arc::new(texels), &mut pending); + let texels = Arc::new(texels); + let over = (Arc::clone(&texels), &mut pending); let storage = self.storage_over_buffer(call, over, descriptor, layout)?; let texture = Texture::made(self, storage, record, None, id_use); - // A shadow made before its pages' (or its pooled memory's) in-place verdict moves in - // place once it passes. - if let Some(pending) = pending { - texture.wait_to_move_in_place(pending); + match pending { + // A shadow made before its pages' (or its pooled memory's) in-place verdict moves in + // place once it passes. + Some(MoveAfter::Verdicts(pending)) => texture.wait_to_move_in_place(pending), + // A shadow of its linear cost over bytes no other texture was made over moves once + // one is (`texture_spans.rs`). + Some(MoveAfter::Aliases(pending)) => { + let shared: Arc = Arc::clone(&texture.0) as _; + let bytes = texels.layout.offset..texels.layout.end(); + (texels.buffer).wait_for_texture_over(bytes, Arc::downgrade(&shared), pending); + } + None => {} } Ok(texture) } @@ -2435,11 +2453,36 @@ impl Device { /// A shadow over host pages made before their class's verdict for its access, or over the /// device's pooled memory before its class's verdict for an image at Metal's pitch there /// (`Device::pooled_pitched_image`), sets `pending` to what it needs to move in place once the - /// verdict passes. Refused as it is. + /// verdict passes; a shadow of its linear cost there, to what it needs to move once another + /// texture is made over its bytes. Once made, the texture's bytes are noted as a texture's + /// (`texture_spans.rs`), and the shadows of their linear cost that waited for another texture + /// over them wait to move in place. Refused as it is. fn storage_over_buffer( &self, call: &'static str, - (texels, pending): (Arc, &mut Option), + (texels, pending): (Arc, &mut Option), + descriptor: &TextureDescriptor, + layout: &TextureLayout, + ) -> Result { + let bytes = texels.layout.offset..texels.layout.end(); + let buffer = texels.buffer.clone(); + let storage = self.storage_decided(call, (texels, pending), descriptor, layout)?; + if !in_place::checking() { + for lone in buffer.note_texture_made(bytes) { + let texture = lone.texture.upgrade().map(Arc::downcast::); + if let Some(Ok(texture)) = texture { + Texture(texture).wait_to_move_in_place(lone.pending); + } + } + } + Ok(storage) + } + + /// [`storage_over_buffer`](Self::storage_over_buffer)'s storage, its bytes not noted. + fn storage_decided( + &self, + call: &'static str, + (texels, pending): (Arc, &mut Option), descriptor: &TextureDescriptor, layout: &TextureLayout, ) -> Result { @@ -2539,14 +2582,29 @@ impl Device { // been made then (`texture/storage_form.rs`). Err((why, Some(ShadowCause::CheckPending(class, _, rows)))) => { let line = self.shared().in_place.line(); - *pending = Some(in_place::PendingMove { + *pending = Some(MoveAfter::Verdicts(in_place::PendingMove { class, rows, padding: texels.padding(line), usage, plan: plan.clone(), descriptor: *descriptor, - }); + })); + why + } + // A shadow of its linear cost, made over bytes no other texture was made + // over (`Device::pooled_pitched_image`): it moves to the image at Metal's + // pitch once another texture is made over them (`texture_spans.rs`). + Err((why, Some(ShadowCause::LinearCost(_)))) => { + let line = self.shared().in_place.line(); + *pending = Some(MoveAfter::Aliases(in_place::PendingMove { + class: PagesClass::Pooled, + rows: texels.rows(line), + padding: texels.padding(line), + usage, + plan: plan.clone(), + descriptor: *descriptor, + })); why } Err((why, _)) => why, @@ -2721,20 +2779,20 @@ impl Device { ), (usage, plan): (TextureUsage, &ImagePlan), descriptor: &TextureDescriptor, - pending: &mut Option, + pending: &mut Option, ) -> Result { if in_place::checking() { return Err(Error::NotInPlace(NotInPlace { why: cause.words() })); } if let ShadowCause::CheckPending(..) = cause { - *pending = Some(in_place::PendingMove { + *pending = Some(MoveAfter::Verdicts(in_place::PendingMove { class, rows, padding, usage, plan: plan.clone(), descriptor: *descriptor, - }); + })); } let renders = in_place::Access::Renders.takes(usage); let accesses = (renders, in_place::Access::Writes.takes(usage)); @@ -3292,10 +3350,15 @@ impl Device { let layout = &texels.layout; let bytes = layout.slice_pitch * (layout.slices - 1) + layout.row_pitch * layout.rows; // The bound chooses between two speeds over bytes only the runtime's commands write - // (a tracked `Private` buffer's), where both forms give the same answer. Over bytes - // the CPU may write, or an untracked texture's, the image lies at any size wherever - // the device's check passed, as over host pages, however much slower. - if bytes > in_place::POOLED_PITCHED_BYTES && texels.only_commands_write() { + // (a tracked `Private` buffer's), where both forms give the same answer, for one + // texture over them: over bytes another texture was made over, each shadow would be + // an image of its own with copies of its own (`texture_spans.rs`). Over bytes the CPU + // may write, or an untracked texture's, the image lies at any size wherever the + // device's check passed, as over host pages, however much slower. + if bytes > in_place::POOLED_PITCHED_BYTES + && texels.only_commands_write() + && !(texels.buffer).textures_made_over(&(layout.offset..layout.end())) + { return Ok(Err(ShadowCause::LinearCost(bytes))); } let line = self.shared().in_place.line(); diff --git a/crates/metal2vulkan-runtime/src/texture_placement.rs b/crates/metal2vulkan-runtime/src/texture_placement.rs index 05df712cf..3ec62b62a 100644 --- a/crates/metal2vulkan-runtime/src/texture_placement.rs +++ b/crates/metal2vulkan-runtime/src/texture_placement.rs @@ -138,7 +138,11 @@ pub enum TextureShadowReason { /// ([`TexturePlacement::NotHostPages`]), as such an image renders and samples slower than the /// shadow's own image with its copies past it, and over memory only the runtime's commands /// write both give the same answer. The same bound on every device. Over a `Shared` or - /// `Managed` buffer, and for an untracked texture, the image is taken at any size. + /// `Managed` buffer, and for an untracked texture, the image is taken at any size. So it is + /// over bytes another texture was made over (another format's, a view's, one made again): + /// each shadow would be an image of its own with copies of its own, so a texture over such + /// bytes takes the image at any size, and the shadow of the first moves to it once another + /// texture is made over its bytes, at a quiet commit (`WorkCounts::pooled_textures_moved_in_place`). LinearCost { /// The bytes of the texture's rows, each to its pitch. bytes: u64, @@ -275,7 +279,8 @@ impl TextureShadowReason { .to_owned(), TextureShadowReason::LinearCost { bytes } => format!( "its rows take {bytes} bytes to their pitch, past the bound up to which it takes \ - a DRM_FORMAT_MOD_LINEAR image at Metal's pitch" + a DRM_FORMAT_MOD_LINEAR image at Metal's pitch, and no other texture was made \ + over its bytes" ), } } diff --git a/crates/metal2vulkan-runtime/src/texture_spans.rs b/crates/metal2vulkan-runtime/src/texture_spans.rs new file mode 100644 index 000000000..9f4af31f3 --- /dev/null +++ b/crates/metal2vulkan-runtime/src/texture_spans.rs @@ -0,0 +1,109 @@ +//! The bytes of a buffer that textures were made over, which the pooled bound reads +//! (`in_place::POOLED_PITCHED_BYTES`, `texture.rs`'s `pooled_pitched_image`). +//! +//! - **Why.** Past the bound, a tracked texture over a `Private` buffer is a shadow of its linear +//! cost (`ShadowCause::LinearCost`): a `DRM_FORMAT_MOD_LINEAR` image renders and samples slower +//! than the shadow's own image, and a shadow whose truth only the runtime's commands write +//! stands across command buffers, copied in once (`shadow_standing.rs`). That holds for one +//! texture over the bytes. A shadow is its texture's own: every other texture over the same +//! bytes (a surface's textures of other formats, made again each frame, its views) makes an +//! image of its own, whose first use copies every texel in, and a write through any of them is +//! a write of the bytes that lets go of every other shadow's standing, whose next use copies +//! every texel in again. A texture over bytes another texture was made over takes the image at +//! Metal's pitch instead, at any size, as over memory the CPU writes: one image over the bytes +//! per texture, no copy, the bytes' own aliasing. +//! - **What is kept.** The runs of bytes textures were made over ([`TextureSpans::note`]), each +//! the texels' first byte to their last, runs that meet joined, at most [`RUNS`] of them: past +//! that, a new run joins the nearest, so a run may hold bytes no texture was made over. That +//! errs toward the image in place, which is as exact as the shadow. A texture's making notes its +//! run once its storage is decided, whatever it took, over any buffer; the placement query reads +//! the runs and notes nothing. +//! - **The first shadow moves.** A shadow of its linear cost made over bytes no other texture was +//! made over waits ([`LoneShadow`]): once a later texture is made over its bytes, it moves to the +//! image at Metal's pitch as a shadow made before its pooled memory's verdicts does +//! (`texture/storage_form.rs`: at the commit of the device's only uncommitted command buffer, +//! with no copy), where the device makes that image then. A view's shadow never moves, as a +//! view's storage never does. One waiting shadow is kept per run at most: a second texture over +//! it takes the waiting one. + +use super::in_place::PendingMove; +use std::any::Any; +use std::ops::Range; +use std::sync::Weak; + +/// The most runs a buffer keeps apart (the module docs). +const RUNS: usize = 8; + +/// The bytes of a buffer that textures were made over, and the shadows of their linear cost +/// that wait for another texture over their bytes (the module docs). +#[derive(Default)] +pub(super) struct TextureSpans { + runs: Vec>, + lone: Vec, +} + +/// A shadow of its linear cost made over bytes no other texture was made over: its texture, +/// held weakly and by type erased (`texture.rs`'s `TextureShared`, whose device holds buffers), +/// what it moves with, and its texels' bytes. +pub(super) struct LoneShadow { + pub(super) texture: Weak, + pub(super) pending: PendingMove, + bytes: Range, +} + +/// Whether two runs of bytes share one. +fn meet(a: &Range, b: &Range) -> bool { + a.start < b.end && b.start < a.end +} + +impl TextureSpans { + /// Whether a texture was made over any of `bytes`. + pub(super) fn made_over(&self, bytes: &Range) -> bool { + self.runs.iter().any(|run| meet(run, bytes)) + } + + /// Note a texture made over `bytes`: the shadows that waited for another texture over them, + /// which stop waiting here and are the caller's to move (the module docs). + pub(super) fn note(&mut self, bytes: Range) -> Vec { + let mut joined = bytes.clone(); + self.runs.retain(|run| { + let meets = meet(run, &joined); + if meets { + joined = joined.start.min(run.start)..joined.end.max(run.end); + } + !meets + }); + if self.runs.len() == RUNS { + // The run nearest the new one (by the gap between them) takes it. + let gap = |run: &Range| match run.end <= joined.start { + true => joined.start - run.end, + false => run.start.saturating_sub(joined.end), + }; + if let Some(near) = (0..self.runs.len()).min_by_key(|&i| gap(&self.runs[i])) { + let run = self.runs.swap_remove(near); + joined = joined.start.min(run.start)..joined.end.max(run.end); + } + } + self.runs.push(joined); + self.lone.retain(|lone| lone.texture.strong_count() > 0); + self.lone + .extract_if(.., |lone| meet(&lone.bytes, &bytes)) + .collect() + } + + /// A shadow of its linear cost was made over `bytes`, which no other texture was made over: + /// it waits for one (the module docs). + pub(super) fn wait( + &mut self, + bytes: Range, + texture: Weak, + pending: PendingMove, + ) { + self.lone.retain(|lone| lone.texture.strong_count() > 0); + self.lone.push(LoneShadow { + texture, + pending, + bytes, + }); + } +} diff --git a/crates/metal2vulkan-runtime/src/work_counts.rs b/crates/metal2vulkan-runtime/src/work_counts.rs index 55d98d4ab..a411f2ecc 100644 --- a/crates/metal2vulkan-runtime/src/work_counts.rs +++ b/crates/metal2vulkan-runtime/src/work_counts.rs @@ -8295,7 +8295,10 @@ pub struct WorkCounts { /// over host pages): each is counted in `pooled_pitched_images` too from then on. Over memory /// the runtime exports (`MemoryExport`), likewise once the check of that exported memory /// passed, to the linear image or the `DRM_FORMAT_MOD_LINEAR` one made for its handle type - /// (the latter counted in `pooled_pitched_images`). A runtime extension: Metal has none. + /// (the latter counted in `pooled_pitched_images`). And tracked textures over a `Private` + /// buffer made shadows of their linear cost (`TextureShadowReason::LinearCost`), the first + /// over their bytes, that moved to that image the same way once another texture was made over + /// their bytes. A runtime extension: Metal has none. pub pooled_textures_moved_in_place: u64, /// Shadow images of textures that moved in place over the device's pooled memory /// (`pooled_textures_moved_in_place`) let go of once the command buffer that took the move diff --git a/docs/API.md b/docs/API.md index bbd30369f..f876844ef 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1894,8 +1894,12 @@ bound. pitch, the same on every device, such a texture over a `Private` buffer, tracked, stays a shadow too (`TextureShadowReason::LinearCost`): there a linear image renders and samples slower than the shadow's own image with its copies, and over memory only the runtime's commands write both give - the same answer (over a `Shared` or `Managed` buffer, and for an untracked texture, the image is - taken at any size, as over host pages); + the same answer, for one texture over the bytes (over a `Shared` or `Managed` buffer, for an + untracked texture, and over bytes another texture was made over, the image is taken at any size: + there each texture's shadow would be an image of its own, copied in whole at its first use and + again after a write through any other; the first texture's shadow moves to its image once + another texture is made over its bytes, at a quiet commit, + `WorkCounts::pooled_textures_moved_in_place`); or the buffer is over the caller's `VkBuffer`, whose memory backs no image of the runtime's; or it is a tiled texture of more than one level (`Buffer::new_tiled_texture`), over any buffer: no image over the buffer's memory holds diff --git a/docs/HOWTO.md b/docs/HOWTO.md index e6b5cb4f2..44f5bd6e2 100644 --- a/docs/HOWTO.md +++ b/docs/HOWTO.md @@ -387,7 +387,8 @@ pitch where its in-place check passed for its pooled memory (for a texture that check of renders that lets a pass change those bytes, as the declaration does, and no byte past the last row's pitch) and, for a tracked texture over a `Private` buffer, its rows take no more bytes than a bound past which such an image renders and samples slower than the shadow (over a `Shared` -or `Managed` buffer, and for an untracked texture, any size) +or `Managed` buffer, for an untracked texture, and over bytes another texture was made over, any +size; the first texture's shadow moves to its image once another is made over its bytes) (`WorkCounts::pooled_pitched_images`; `TextureShadowReason::LinearCost` past it; `HostPageTexturePolicy::Shadow` turns it off; one made before that check answered is a shadow that moves to the image at a quiet commit once it passed, as one over host pages moves in place,