diff --git a/crates/metal2vulkan-air/src/canon/rate_map_data.rs b/crates/metal2vulkan-air/src/canon/rate_map_data.rs index 156ef07cd..223befdae 100644 --- a/crates/metal2vulkan-air/src/canon/rate_map_data.rs +++ b/crates/metal2vulkan-air/src/canon/rate_map_data.rs @@ -200,8 +200,10 @@ pub fn tile_line( /// Write one axis's tables: tiles `(screen extent, physical extent)` from screen 0, every one but /// the last [`GRANULARITY`] physical pixels wide and at least as many screen pixels, into -/// `to_screen` and `to_physical` (each a table's [`TABLE_WORDS`] words, zero on entry). Entries -/// past a table's words are not written. +/// `to_screen` and `to_physical` (each a table's [`TABLE_WORDS`] words). It writes both words of +/// each entry the axis has and no other word, so a table that held another axis keeps that axis's +/// entries past this one's, as Metal's reset of a map leaves them. Entries past a table's words +/// are not written. pub fn encode_axis(tiles: &[(u32, u32)], to_screen: &mut [u32], to_physical: &mut [u32]) { let mut starts = Vec::with_capacity(tiles.len()); let (mut s, mut p) = (0u32, 0u32); diff --git a/crates/metal2vulkan-runtime/src/command_buffer/mod.rs b/crates/metal2vulkan-runtime/src/command_buffer/mod.rs index 5f553c28d..43546f497 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/mod.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/mod.rs @@ -1827,6 +1827,12 @@ impl CommandBuffer { self.state().failures_injected = count; } + /// The bytes its upload arena's regions took: a device test's measure (`tests::rerun_arenas`). + #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] + pub(crate) fn upload_bytes(&self) -> u64 { + self.state().uploads.bytes() + } + /// Whether `waiting` holds this command buffer. pub(crate) fn is(&self, waiting: &dyn Waiting) -> bool { self.0.address() == waiting.address() @@ -2552,7 +2558,7 @@ impl CommandBuffer { .filter(|(_, prepared)| prepared.pipelines) .map(|((work, _), _)| work.clone()) .collect(); - let (waits, away, reaches, unreplayable) = { + let (waits, away, reaches, unreplayable, reset) = { let mut state = self.state(); state.committing = false; if let Some(failure) = failure { @@ -2601,10 +2607,20 @@ impl CommandBuffer { } // A rebind before its first submission of a buffer its replayable encoders, or its // work on the GPU alone, named encodes or records them again (`reencode.rs`): noted - // while their holds still refuse one. - let (unreplayable, keys) = state.keep_replays(); - if !keys.is_empty() { - device.shared().rebinds.wait_for_replay(&self.0, keys); + // while their holds still refuse one. So does a reset of a rasterization-rate map + // their passes are over (`rate_mapped_pass.rs`): noted first, then a reset before the + // commit found here, marked before the scheduler sees the command buffer. + let kept = state.keep_replays(); + if !kept.keys.is_empty() || !kept.maps.is_empty() { + device + .shared() + .rebinds + .wait_for_replay(&self.0, kept.keys, kept.maps); + } + let unreplayable = kept.gone; + let reset = state.rate_maps_reset(); + if reset.0 { + self.0.mark_reencode(); } if let Some(slot) = &mut state.slot { slot.committed(); @@ -2677,7 +2693,7 @@ impl CommandBuffer { .find(|image| image.rests_out_of_general()); // Its commands may reach every texture through its resource ID where one bound a // heap set. - (waits, away, state.heaps.bound(), unreplayable) + (waits, away, state.heaps.bound(), unreplayable, reset) }; // Each making the batches wait for wakes the scheduler as it finishes, with no lock // held (`render/pending.rs`), registered before the scheduler first looks at the batches: @@ -2703,6 +2719,16 @@ impl CommandBuffer { .shared() .scheduler .commit(&self.0, self.0.queue.id(), waits); + // Its passes that took a rasterization-rate map since reset, encoded again in this call + // as a reset's are; its first submission waits for them (marked above). Those it cannot + // encode again are announced. + let (again, unencoded) = reset; + if again { + self.0.reencode(); + } + for unlogged in unencoded { + crate::rate_mapped_pass::degrade_unencoded(device, unlogged); + } if let Some(image) = away { device.degrade(Degradation::WrappedImageLayoutTransitions, || { image.notice() diff --git a/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs b/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs index c711cf278..1f6fab89b 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/reencode.rs @@ -91,6 +91,9 @@ impl CommandBufferShared { let device = &self.device; // The encoders of its event groups not submitted yet: those before were judged, and run // over the pages they took. + // So are those whose pass took a rasterization-rate map since reset; one that kept no + // log draws by the map as it took it, announced (`rate_mapped_pass.rs`). + let mut unencoded = Vec::new(); let moved: Vec<(usize, Arc)> = { let state = lock(&self.state); match state.finished() { @@ -103,15 +106,23 @@ impl CommandBufferShared { (state.ended.iter().enumerate()) .filter(|(at, _)| open.contains(at)) .filter_map(|(at, record)| { - let replay = record.replay.as_ref()?; - submitting - .rebound(&record.taken) - .then(|| (at, Arc::clone(replay))) + let reset = record.taken.rate_map_reset(); + let Some(replay) = record.replay.as_ref() else { + if reset { + unencoded.push(record.unlogged); + } + return None; + }; + let moved = submitting.rebound(&record.taken) || reset; + moved.then(|| (at, Arc::clone(replay))) }) .collect() } } }; + for unlogged in unencoded { + crate::rate_mapped_pass::degrade_unencoded(device, unlogged); + } let handle = CommandBuffer(Arc::clone(self)); // The encoders encoded again, whose segments the encoding again recorded. let mut spliced = Vec::new(); @@ -123,7 +134,14 @@ impl CommandBufferShared { Ok(replayed) => replayed, Err(error) => { counts.reencode_refused(); - lock(&self.state).ended[at].refused = Some(error.to_string()); + let reset = { + let mut state = lock(&self.state); + state.ended[at].refused = Some(error.to_string()); + state.ended[at].taken.rate_map_reset() + }; + if reset { + crate::rate_mapped_pass::degrade_unencoded(device, None); + } continue; } }; @@ -138,8 +156,15 @@ impl CommandBufferShared { Err(unspliced) => { counts.reencode_refused(); let refusal = "its place holds other parts or work than its encoding again's"; - lock(&self.state).ended[at].refused = Some(refusal.to_owned()); + let reset = { + let mut state = lock(&self.state); + state.ended[at].refused = Some(refusal.to_owned()); + state.ended[at].taken.rate_map_reset() + }; drop(unspliced); + if reset { + crate::rate_mapped_pass::degrade_unencoded(device, None); + } } } } @@ -396,16 +421,20 @@ impl State { /// of without this lock: every log where an encoder used command predication, and those of /// encoders the commit's failure fails (they run nothing). The keys of buffers over host pages /// the encoders whose logs stay named, and the work its commit recorded on the GPU alone, - /// sorted, each once (`Rebinds::wait_for_replay`). - pub(super) fn keep_replays(&mut self) -> (Vec>, Box<[ResourceKey]>) { + /// sorted, each once, and the identities of the rasterization-rate maps its encoders' passes + /// are over, logged or not (a reset encodes the one again, or announces the other: + /// `Rebinds::wait_for_replay`). + pub(super) fn keep_replays(&mut self) -> KeptReplays { let mut gone = Vec::new(); let mut keys = Vec::new(); + let mut maps = Vec::new(); let predicated = self.predicated; for (at, record) in self.ended.iter_mut().enumerate() { let fails = self .failed_at_commit .as_ref() .is_some_and(|failed| failed.fails(at)); + maps.extend(record.taken.rate_map_id()); if predicated || fails { if let Some(log) = record.replay.take() { gone.push(log); @@ -429,6 +458,42 @@ impl State { } keys.sort_unstable(); keys.dedup(); - (gone, keys.into_boxed_slice()) + maps.sort_unstable(); + maps.dedup(); + KeptReplays { + gone, + keys: keys.into_boxed_slice(), + maps: maps.into_boxed_slice(), + } + } + + /// As it commits, once its replays are kept ([`State::keep_replays`]): whether an encoder + /// whose pass took a rasterization-rate map since reset, before the commit, is to be encoded + /// again before its first submission, its log kept (`rate_mapped_pass.rs`); and why each that + /// kept no log did not, which draws by the map as it took it, for the caller to announce + /// without this lock (`rate-map-reset-unencoded`). + pub(super) fn rate_maps_reset(&self) -> (bool, Vec>) { + let mut again = false; + let mut unencoded = Vec::new(); + for record in &self.ended { + if !record.taken.rate_map_reset() { + continue; + } + match record.replay { + Some(_) => again = true, + None => unencoded.push(record.unlogged), + } + } + (again, unencoded) } } + +/// What [`State::keep_replays`] keeps and lets go of. +pub(super) struct KeptReplays { + /// The logs no rebind encodes again, for the caller to let go of without the lock. + pub(super) gone: Vec>, + /// The keys of the buffers over host pages the kept logs' encoders named. + pub(super) keys: Box<[ResourceKey]>, + /// The identities of the rasterization-rate maps its encoders' passes are over. + pub(super) maps: Box<[usize]>, +} diff --git a/crates/metal2vulkan-runtime/src/command_buffer/rerun.rs b/crates/metal2vulkan-runtime/src/command_buffer/rerun.rs index bf77938db..a2e25cd21 100644 --- a/crates/metal2vulkan-runtime/src/command_buffer/rerun.rs +++ b/crates/metal2vulkan-runtime/src/command_buffer/rerun.rs @@ -23,9 +23,10 @@ //! wrote: an indirect dispatch's arguments, an execution's records or its block's counter), waits //! for them too, then records it again as its host step did (`Deferred::step`), or as the commit //! did on the GPU alone (`Deferred::record_on_gpu`), and goes on. Those recordings come from a -//! command pool of the check's own, taken back after each run again, so a loop that runs on -//! holds no more command buffers than one run; the descriptor sets and uploads they take stay -//! with the command buffer until it completes, as its first run's do. +//! command pool of the check's own, and take their descriptor sets and uploads from arenas of +//! its own, lent to the command buffer meanwhile ([`RunArenas`]); once the run again completed, +//! the pool is taken back, the sets' pools reset and the uploads let go (their chunks parked +//! for the next run, `recycle.rs`), so a loop that runs on holds no more of them than one run. //! - **The check** is a host step (`Deferred::Loop`), its segment the first of the batch after the //! laying: once the work before it completed, it reads the unit's halt word. 0: the batch goes. //! Else a thread of its own ([`run_again`]) runs the laying again on the command buffer's @@ -49,6 +50,7 @@ use super::{ command_pool, recording_error, step_error, submission_error, CommandBuffer, CommandBufferShared, }; use crate::deferred::{Deferred, StepInputs}; +use crate::descriptor_arena::DescriptorArena; use crate::device::lock; use crate::encoder::{Recorded, RecordedSegment, Segment}; use crate::error::{internal, CommandBufferError, Error}; @@ -56,7 +58,7 @@ use crate::exit_guard::{self, Call}; use crate::retained::Retained; use crate::spares::CommandPool; use crate::tracker::EncoderUses; -use crate::upload::Upload; +use crate::upload::{Upload, Uploads}; use ash::vk; use metal2vulkan::bind::ReplayFaults; use std::sync::atomic::Ordering; @@ -74,6 +76,41 @@ pub(crate) enum Piece { Apart(Deferred), } +/// The arenas a check's runs again take their descriptor sets and uploads from, each lent to the +/// command buffer while a run's work apart records (`Uploads::lend`, `DescriptorArena::lend`), +/// and emptied once the run completed ([`settle`](Self::settle)). +struct RunArenas { + uploads: Arc>, + descriptors: Arc>, +} + +impl RunArenas { + /// Empty arenas. + fn new() -> RunArenas { + RunArenas { + uploads: Arc::new(Mutex::new(Uploads::new())), + descriptors: Arc::new(Mutex::new(DescriptorArena::default())), + } + } + + /// Lend the arenas to the command buffer of `state`, or (`false`) take them back. + fn lend(&self, state: &mut super::State, lent: bool) { + state.uploads.lend(lent.then(|| Arc::clone(&self.uploads))); + state + .descriptors + .lend(lent.then(|| Arc::clone(&self.descriptors))); + } + + /// The run again completed, so nothing uses what it took: the sets' pools reset for the next + /// run, and the uploads let go, without a lock of the command buffer (a chunk's last holder + /// parks it, `recycle.rs`). Inside a section of the exit guard; refused as the reset is. + fn settle(&self) -> Result<(), Error> { + let uploads = lock(&self.uploads).take(); + drop(uploads); + lock(&self.descriptors).reset() + } +} + /// How a run again records a piece of work apart: as its first run did. enum Again { /// As its host step did, from `inputs`, after the work before it completed where `waits`. @@ -214,15 +251,15 @@ impl LoopCheck { Ok(nothing()) } - /// Run the laying again on `buffer`'s `VkQueue`, its work apart recorded from `pool`, and - /// read the halt word. + /// Run the laying again on `buffer`'s `VkQueue`, its work apart recorded from `pool` and + /// `arenas`, and read the halt word. fn run_once( &self, buffer: &Hold, - pool: &Arc>, + (pool, arenas): (&Arc>, &RunArenas), ) -> Round { let mut recordings = Vec::new(); - let ran = self.run_pieces(buffer, pool, &mut recordings); + let ran = self.run_pieces(buffer, (pool, arenas), &mut recordings); // Its recordings' command buffers go back to the pool for the next run: they ended there, // none of the command buffer's own pool (`CommandBufferShared::end_raw` counted them). let ended: usize = recordings.iter().map(|done| done.raws.len()).sum(); @@ -245,6 +282,14 @@ impl LoopCheck { Err(Stop::Failed(error)) => return Round::Failed(error), Err(Stop::Exiting) => return Round::Exiting, } + { + let Some(_busy) = exit_guard::enter() else { + return Round::Exiting; + }; + if let Err(error) = arenas.settle() { + return Round::Failed(recording_error(&buffer.device, error)); + } + } buffer.device.shared().counts.predicated_loop_ran_again(); match self.halted() { true => Round::Again, @@ -258,7 +303,7 @@ impl LoopCheck { fn run_pieces( &self, buffer: &Hold, - pool: &Arc>, + sources: (&Arc>, &RunArenas), recordings: &mut Vec, ) -> Result<(), Stop> { let device = &buffer.device; @@ -278,7 +323,7 @@ impl LoopCheck { self.submit(buffer, &submits)?; submits.clear(); } - let done = self.record(buffer, pool, work, again)?; + let done = self.record(buffer, sources, work, again)?; submits.extend(&done.raws); recordings.push(done); } @@ -287,12 +332,13 @@ impl LoopCheck { self.submit(buffer, &submits) } - /// Record `work` again as `again` says, its command buffers from `pool`, as a host step: on - /// this thread, inside a section of the exit guard, with no lock of the command buffer held. + /// Record `work` again as `again` says, its command buffers from `pool` and its sets and + /// uploads from `arenas`, as a host step: on this thread, inside a section of the exit guard, + /// with no lock of the command buffer held. fn record( &self, buffer: &Hold, - pool: &Arc>, + (pool, arenas): (&Arc>, &RunArenas), work: &Deferred, again: &Again, ) -> Result { @@ -302,7 +348,11 @@ impl LoopCheck { }; let _turn = lock(&buffer.reencoding); let command_buffer = CommandBuffer(Arc::clone(buffer)); - lock(&buffer.state).rerun_pool = Some(Arc::clone(pool)); + { + let mut state = lock(&buffer.state); + state.rerun_pool = Some(Arc::clone(pool)); + arenas.lend(&mut state, true); + } let record = || { exit_guard::host_step(|| match again { Again::OnGpu => (work.record_on_gpu(&command_buffer)?) @@ -317,6 +367,7 @@ impl LoopCheck { }; let mut state = lock(&buffer.state); state.rerun_pool = None; + arenas.lend(&mut state, false); match recorded { // Its first run named no detached buffer, or the command buffer failed there. Ok(done) if done.taken.dead() => { @@ -454,16 +505,21 @@ fn run_again(check: &LoopCheck, buffer: Hold) { }; command_pool(device, family).map(|pool| Arc::new(Mutex::new(pool))) }; + let arenas = RunArenas::new(); let (failure, settled) = match &pool { Ok(pool) => loop { - let round = before_round(&buffer).unwrap_or_else(|| check.run_once(&buffer, pool)); + let round = + before_round(&buffer).unwrap_or_else(|| check.run_once(&buffer, (pool, &arenas))); match round { Round::Again => continue, Round::Ended => break (None, true), // A recording it left unended leaves the pool to be reset. Round::Failed(error) => break (Some(error), false), // What it holds stays held to the process's end, as the scheduler's does. - Round::Exiting => return std::mem::forget(buffer), + Round::Exiting => { + std::mem::forget(arenas); + return std::mem::forget(buffer); + } } }, Err(error) => (Some(recording_error(device, error.clone())), true), diff --git a/crates/metal2vulkan-runtime/src/degradation.rs b/crates/metal2vulkan-runtime/src/degradation.rs index 0a312b6ad..d38b97e3e 100644 --- a/crates/metal2vulkan-runtime/src/degradation.rs +++ b/crates/metal2vulkan-runtime/src/degradation.rs @@ -1413,9 +1413,10 @@ degradations! { dispatch of another dispatch type ends the process), the device gives the older \ release's: it can stop or refuse a texture or a dispatch the host's Metal makes, and \ never makes one the older release stops"; - /// A render pass that loads a color attachment of an extended-range or padded 10-bit - /// format (`BGR10_XR`, `BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and - /// their sRGB twins, and `RGB10A2Unorm_sRGB`), or under + /// A render pass that loads a color attachment of an extended-range, padded 10-bit or + /// bfloat format (`BGR10_XR`, `BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, + /// `RG10Unorm_X12` and their sRGB twins, `RGB10A2Unorm_sRGB`, `R16Bfloat`, `RG16Bfloat` + /// and `RGBA16Bfloat`), or under /// [`metal2vulkan::device::TileStorePolicy::Exact`] of a /// signed normalized format or `RGB9E5Float`, stores it and draws, whose load pass /// (`render/unused_bits_load.rs`) rewrites every 32 x 32 tile of its render area: Metal's @@ -1429,17 +1430,30 @@ degradations! { canonical (BGR10_XR's bits 30 and 31 ones, BGRA10_XR's low six bits of each field \ and the two-plane color word's top two bits zeros) and BGRA10_XR alpha codes \ clamped to [384, 894], so an out-of-range raw alpha reads back changed, a padded \ - word's low six bits zeroed (an sRGB twin's code moved through Metal's table) and, \ - under the exact tile store, a signed normalized minimum code raised and an \ - RGB9E5Float word normalized; the tiles a draw reaches are Metal's"; + word's low six bits zeroed (an sRGB twin's code moved through Metal's table), a \ + bfloat code moved through half (out of half's range to an infinity or zero, a NaN \ + to 0x7fc0) and, under the exact tile store, a signed normalized minimum code raised \ + and an RGB9E5Float word normalized; the tiles a draw reaches are Metal's"; /// A draw in a render pass over a rasterization-rate map of no layers that was made after - /// the device released a map of one or more layers (`rate_mapped_pass.rs`). The draw + /// the device released a map of one or more layers, or reset from one of layers + /// (`rate_mapped_pass.rs`). The draw /// writes nothing, where Metal draws: an Apple M4 and an Apple M3 Max drew a 64-pixel /// map's physical rows 0 to 15 over a 64-pixel target at the positions of a pass with no /// map, whatever map was released. Announced at the draw. ZeroLayerMapAfterRelease = "zero-layer-map-after-release", Precision, "the draws write nothing, where Metal draws rows of the pass (a 64-pixel map's rows 0 \ to 15, at the positions of a pass with no map)"; + /// A render pass over a rasterization-rate map that was reset + /// (`RasterizationRateMap::reset_using_descriptor`) after the pass took it and before + /// its command buffer was submitted, in an encoder the runtime could not encode again + /// (it kept no log: a command predication's command buffer, a render encoder opened + /// while a buffer of the device was detached, or one that left work for a host step; + /// `rate_mapped_pass.rs`). The pass draws by the map as it took it, where Metal's GPU + /// reads the map as it runs the pass (the M3 Max under macOS 27.0.1). Announced at the + /// commit, or at the reset where the command buffer was committed. + RateMapResetUnencoded = "rate-map-reset-unencoded", Precision, + "the pass draws by the map as it took it, where Metal's GPU draws by the map as \ + reset"; /// A texture made in a heap over host pages (`new_heap_with_bytes_no_copy`), or a depth /// or stencil texture made in any heap as a shadow of Metal's tiles (on a driver that /// lays such images apart from their memory or keeps them GPU-optimized: MoltenVK), that diff --git a/crates/metal2vulkan-runtime/src/descriptor_arena.rs b/crates/metal2vulkan-runtime/src/descriptor_arena.rs index f54482b0a..a085985fc 100644 --- a/crates/metal2vulkan-runtime/src/descriptor_arena.rs +++ b/crates/metal2vulkan-runtime/src/descriptor_arena.rs @@ -29,11 +29,13 @@ //! more descriptors than the pool it would open ([`DescriptorArena::fitted`]), so a texture that //! holds its sets for its life holds no larger pool than its own. -use super::binding::SetCache; +use super::binding::{SetCache, Write}; +use super::device::lock; use super::error::{vulkan, Error}; use super::spares::{release_in_section, DescriptorPool}; use super::Device; use ash::vk; +use std::sync::{Arc, Mutex}; /// The sets of a command buffer's first pool. pub(super) const FIRST: u32 = 16; @@ -176,6 +178,10 @@ pub(crate) struct DescriptorArena { /// (`binding::SetCache`), from its first command that looks one up: forgotten as the pools /// go. Boxed, so a fitted arena, which keeps none, stays small. sets: Option>, + /// The arena of a predicated loop's check, lent while it records a run again + /// (`command_buffer/rerun.rs`): every set is allocated from it, and kept there, meanwhile, + /// and its pools are reset once that run completed ([`reset`](Self::reset)). + lent: Option>>, } impl DescriptorArena { @@ -188,9 +194,16 @@ impl DescriptorArena { device: None, fitted: true, sets: None, + lent: None, } } + /// Allocate every set from `lent`, a predicated loop's check's arena, and keep it there, + /// while it is lent; `None`: from this one again. + pub(crate) fn lend(&mut self, lent: Option>>) { + self.lent = lent; + } + /// One set of `layout`, whose needs are `needs` (not empty), from the newest pool with room /// for it, or a pool opened for it: a spare of the device's with room, else a new one. pub(crate) fn allocate( @@ -199,6 +212,9 @@ impl DescriptorArena { layout: vk::DescriptorSetLayout, needs: &SetNeeds, ) -> Result { + if let Some(lent) = &self.lent { + return lock(lent).allocate(device, layout, needs); + } let raw = device.shared().vk(); let at = match self.book.place(needs) { Ok(at) => at, @@ -244,10 +260,64 @@ impl DescriptorArena { Ok(set) } - /// The sets 0 of its pools the command buffer's recorded commands wrote, by what they hold - /// (`binding::SetCache`). - pub(crate) fn sets(&mut self) -> &mut SetCache { - self.sets.get_or_insert_default() + /// The set 0 of `layout` holding `writes` that one of the command buffer's recorded commands + /// wrote (`binding::SetCache::find`): of its own pools, or of the arena lent, which its own + /// outlive. + pub(crate) fn find( + &mut self, + layout: vk::DescriptorSetLayout, + writes: &[Write], + ) -> Option { + let own = (self.sets.as_mut()).and_then(|sets| sets.find(layout, writes)); + match &self.lent { + Some(lent) if own.is_none() => lock(lent).find(layout, writes), + _ => own, + } + } + + /// Keep `set`, of `layout`, written with `writes`, once its command recorded + /// (`binding::SetCache::keep`): in the arena lent where one is, whose pools it came from. + pub(crate) fn keep( + &mut self, + layout: vk::DescriptorSetLayout, + set: vk::DescriptorSet, + writes: &[Write], + ) { + match &self.lent { + Some(lent) => lock(lent).keep(layout, set, writes), + None => self.sets.get_or_insert_default().keep(layout, set, writes), + } + } + + /// How many pools it holds (a device test's measure). + #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] + pub(crate) fn pools(&self) -> usize { + self.pools.len() + } + + /// Reset every pool, for the sets of the commands recorded next: no command uses their sets + /// any more (the run again of a predicated loop's check completed, `command_buffer/rerun.rs`). + /// Inside a section of the exit guard. Refused as `vkResetDescriptorPool` refuses, the pools + /// then released. + pub(crate) fn reset(&mut self) -> Result<(), Error> { + self.sets = None; + let Some(device) = &self.device else { + return Ok(()); + }; + let raw = device.shared().vk(); + for pool in &self.pools { + // SAFETY: no pending command uses the pool's sets (the caller's), and only this arena + // holds it. + let reset = unsafe { + raw.reset_descriptor_pool(pool.raw, vk::DescriptorPoolResetFlags::empty()) + }; + if let Err(error) = reset { + self.release(); + return Err(vulkan(error)); + } + } + self.book.rooms = self.pools.iter().map(|pool| pool.room.clone()).collect(); + Ok(()) } /// Every pool, taken out, for the caller to give back or release where it holds no lock: to @@ -261,6 +331,7 @@ impl DescriptorArena { device: self.device.clone(), fitted: self.fitted, sets: None, + lent: None, } } diff --git a/crates/metal2vulkan-runtime/src/encoder.rs b/crates/metal2vulkan-runtime/src/encoder.rs index b9cb0463b..e22cf1741 100644 --- a/crates/metal2vulkan-runtime/src/encoder.rs +++ b/crates/metal2vulkan-runtime/src/encoder.rs @@ -588,7 +588,7 @@ impl EncoderCore { self.device().shared().counts.set_zero_set_reused(); return Ok((Some(set), None)); } - let found = (self.command_buffer().state().descriptors.sets()).find(layout, writes); + let found = (self.command_buffer().state().descriptors).find(layout, writes); if let Some(set) = found { self.device().shared().counts.set_zero_set_found(); self.last_set_zero.keep(layout, set, writes); @@ -613,11 +613,7 @@ impl EncoderCore { /// records, so every object its writes name is held until the command buffer completes. pub(super) fn keep_set_zero(&mut self, written: WrittenSet, writes: &[Write]) { self.last_set_zero.keep(written.layout, written.set, writes); - (self.command_buffer().state().descriptors.sets()).keep( - written.layout, - written.set, - writes, - ); + (self.command_buffer().state().descriptors).keep(written.layout, written.set, writes); } /// The queue flags of the family its command buffer records for: its queue's `VkQueue`'s. @@ -1850,14 +1846,25 @@ impl EncoderCore { self.faults.get_or_insert(error); } + /// Note that its render pass is over `map`, which it took as `state`: a reset of the map + /// before its command buffer's submission has it encoded again (`rate_mapped_pass.rs`). + pub(super) fn take_rate_map( + &mut self, + map: crate::rate_map::RasterizationRateMap, + state: std::sync::Arc, + ) { + self.taken.take_rate_map(map, state); + } + /// End the encoder, one of `kind` that made `residency` resident (a compute or render /// encoder's): its shadowed textures written since their last copy back are copied back, /// it joins the command buffer's ended encoders (`State::encoder_ended`), and its recording /// and what it used join the command buffer's, in order, one part at a time, each part /// after the first in a batch of its own. - /// The command buffer keeps `replay`, the encoder's log (`replay.rs`), where a rebind before - /// its first submission may need the encoder encoded again (a command of it named a buffer - /// over host pages, detached ones included) and the encoder can be (it left no segment for + /// The command buffer keeps `replay`, the encoder's log (`replay.rs`), where a rebind or a + /// reset before its first submission may need the encoder encoded again (a command of it + /// named a buffer over host pages, detached ones included, or its pass is over a + /// rasterization-rate map) and the encoder can be (it left no segment for /// later but one an encoding again records at once, `Segment::records_again`, and fails /// nothing as it commits); else the log goes here. pub(super) fn end_with_replay( @@ -1891,7 +1898,7 @@ impl EncoderCore { // Why it keeps none, where a command named a buffer over host pages: the rebound notice // says (`command_buffer/rebound_use.rs`). let unlogged = match &replay { - _ if !self.taken.names_a_pin() => None, + _ if !self.taken.encodes_again() => None, None => Some(Unlogged::NoCalls), Some(_) if !self.segments.iter().all(Segment::records_again) => { Some(Unlogged::Segments) @@ -1906,7 +1913,7 @@ impl EncoderCore { let keeps = self.segments.iter().all(Segment::records_again) && self.fails_command_buffer.is_none() && self.faults.is_none() - && self.taken.names_a_pin(); + && self.taken.encodes_again(); if !keeps { self.device().shared().scheduler.spare_logs().give(log); return None; diff --git a/crates/metal2vulkan-runtime/src/rate_map.rs b/crates/metal2vulkan-runtime/src/rate_map.rs index c5ff01cb0..751c49ca3 100644 --- a/crates/metal2vulkan-runtime/src/rate_map.rs +++ b/crates/metal2vulkan-runtime/src/rate_map.rs @@ -1,5 +1,5 @@ -//! `RasterizationRateMap` (`MTLRasterizationRateMap`) and `Device::new_rasterization_rate_map` -//! (Metal's bytes and arithmetic). +//! `RasterizationRateMap` (`MTLRasterizationRateMap`), `Device::new_rasterization_rate_map` and +//! `RasterizationRateMap::reset_using_descriptor` (Metal's bytes and arithmetic). //! //! - **The compile layer's map.** A map is the compile layer's compile of its descriptor //! ([`metal2vulkan::bind::RasterizationRateMap::new`], Apple's rule), with the descriptor's @@ -8,17 +8,19 @@ //! arithmetic; and its coordinate maps are Apple's CPU arithmetic over the same bytes. Measured //! on an Apple M4 and an M3 Max: the bytes of every map probed and every answer, bit for bit. A //! render pass over a map that is not the identity draws by regions whose lines are the tiles' -//! exact lines, a near-equivalent of Apple's fixed-point ones, so the map's creation announces -//! the `rasterization-rate-map` degradation. +//! exact lines, a near-equivalent of Apple's fixed-point ones, so the map's creation (or the +//! reset that compiles it) announces the `rasterization-rate-map` degradation. //! - **What Metal's API validation stops**, measured by our probes on an M3 //! Max and an M4 alike, is refused at creation, `Invalid` with [`RateMapProblem`]: a screen width -//! or height of 0 or past 32768, and a layer count past 2. The count is Metal's `layerCount`: +//! or height of 0 or past 32768, and a layer count past 2, but for a `Mutable` descriptor, +//! whose map plain Metal makes whatever it holds (below). +//! The count is Metal's `layerCount`: //! the layers from index 0 up to the first without samples on an axis, which Metal's descriptor //! holds as nil; the map is made of those, and the layers after are ignored, as Metal ignores //! them. Metal's validation also stops a count of 0, but Metal makes such a map without it, and //! so does the runtime: its parameter data is Metal's (no horizontal tables, a vertical axis of //! the least quality), and a render pass over it runs its load, clear, and store actions and -//! draws nothing. +//! each draw's vertex function, and rasterizes nothing. //! - **Where the compile is this crate's bound.** Metal takes a screen of up to 32768 pixels a //! side and any samples; the compile layer compiles only where Apple's compile is measured, //! and refuses the rest, `Error::RateMap` with its @@ -27,17 +29,44 @@ //! - **Metal's answers.** `screenSize` is the descriptor's, depth 1; `physicalGranularity` 32 by //! 32, depth 1; `parameterBufferSizeAndAlign` 24,624 bytes, align 4; the coordinate maps past //! the layers read the last layer (both Macs, probes 7 and 9). `physicalSizeForLayer:` past the -//! layers is the layers' shared vertical extent on Metal too, but its width Metal reads past -//! its own layer table (probe 9: 0 just past a map of one layer, else a screen side, the -//! vertical extent or a small number, by index; a map of no layers answers 0 by 16 at layers 0 -//! and 1 and 16 by 16 at layer 2): the runtime answers width 0 there, and -//! its vertical extent. A map of no layers' coordinate maps end the process on Metal (all 12 -//! probed queries); the runtime answers the decode of its bytes, 0 across. -//! - **A map of no layers made after a released one**. The device notes when it releases a map of -//! one or more layers (its last handle dropped); a map of no layers made after that is one whose -//! passes Metal draws (an Apple M4 and an Apple M3 Max drew a 64-pixel map's rows 0 to 15 as with -//! no map), where the runtime draws nothing, so a draw in such a pass announces -//! `zero-layer-map-after-release` (`rate_mapped_pass.rs`). +//! layers is the layers' shared vertical extent on Metal too, and the width the map last held +//! for that layer below 2, 0 for one it never held (a reset leaves it, below); past layer 1 +//! Metal reads past its own layer table (probe 9: a screen side, the vertical extent or a small +//! number, by index; a map of no layers answers 16 by 16 at layer 2): the runtime answers width +//! 0 there, and its vertical extent. A map of no layers' coordinate maps end the process on +//! Metal (all 12 probed queries): the runtime refuses them, `Invalid` with +//! [`RateMapProblem::NoLayers`]. +//! - **Mutability** (Apple's private `mutability`, the M3 Max under macOS 27.0.1, each case in a +//! process of its own). A map answers its descriptor's (`Immutable` unless set). A map of a +//! `Mutable` descriptor is not compiled until a reset: it answers the descriptor's screen size +//! and layer count, a physical size of 0 by 0 (depth 1) at every layer, the screen-to-physical +//! map (0, 0), granularity and parameter size as every map, and its copy writes 24,624 zeros; +//! its physical-to-screen map ends Metal's process, refused here, `Invalid` with +//! [`RateMapProblem::NotCompiled`]. Plain Metal makes such a map of a descriptor its API +//! validation stops (three layers, a screen side of 0 or of 40000), and so does the runtime: it +//! answers the same, and its reset compiles as any. A pass over it runs its load, clear and store actions and +//! each draw's vertex function, and rasterizes nothing. A map of `Default` (0) or any other +//! mutability is compiled at creation, as an immutable one. +//! - **A reset** (`resetUsingDescriptor:`, Apple's private call, on a map of any mutability) +//! compiles the descriptor into the map, which keeps its label and mutability. Metal's API +//! validation does not look at the reset's descriptor; a layer count past 2 ends Metal's +//! process (refused, `Invalid` with [`RateMapProblem::LayerCount`]), and the compile layer's +//! bounds hold (a screen side of 0, which Metal compiles to no physical extent on that axis, +//! among them: `Error::RateMap`). Metal writes the new map's tables over the old: every entry the +//! new map writes (`metal2vulkan::bind::RasterizationRateMap::new_over`), and every other word +//! as it was (a map reset to no layers keeps its horizontal tables, and its physical width at +//! each layer below 2), so the parameter data is Metal's. A render pass reads the map as the GPU +//! runs it: a reset after the encoder is made, after its draws, after `end_encoding`, and after +//! `commit` while the command buffer waits for an event shows in the pass, and one in two +//! passes of one command buffer alike; a reset after the command buffer completed does not. +//! The runtime plans each draw by the map as the encoder takes it; a pass that took a map since +//! reset is encoded again, from its log, before the submission of its command buffer +//! (`rate_mapped_pass.rs`). +//! - **A map of no layers made, or reset, after layers**. The device notes when it releases a map +//! of one or more layers (its last handle dropped); a map of no layers made after that, or reset +//! from a map of layers, is one whose passes Metal draws (an Apple M4 and an Apple M3 Max drew a +//! 64-pixel map's rows 0 to 15 as with no map), where the runtime draws nothing, so a draw in +//! such a pass announces `zero-layer-map-after-release` (`rate_mapped_pass.rs`). //! - **The copy.** `copy_parameter_data_to_buffer` writes the parameter data through the buffer's //! mapping, at any offset, as Metal takes a misaligned one. It refuses a buffer of another //! device, a `Private` buffer (Metal's copy ends the process there), and a write past the @@ -46,20 +75,22 @@ use super::buffer::Buffer; use super::capabilities::RATE_MAP_LAYERS; use super::degradation::Degradation; -use super::device::Device; +use super::device::{lock, Device}; use super::error::{internal, invalid, Error, Problem}; use super::heap::SizeAndAlign; use super::values::{Coordinate2D, Size}; -use metal2vulkan::bind::{RateMapDescriptor, RateMapError}; +use metal2vulkan::bind::{RateMapDescriptor, RateMapError, UnpinnedCompile}; +use metal2vulkan::metal::Mutability; use std::sync::atomic::Ordering; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; /// The largest screen width or height Metal's API validation takes ("screenSize.width (0) /// must be >0 and <=32768"). const MAX_SCREEN_EXTENT: u32 = 32768; -/// What a rasterization-rate map's descriptor did wrong (`Problem::RateMap`): what Metal's API -/// validation stops at `newRasterizationRateMapWithDescriptor:` (an M3 Max and an M4). +/// What a rasterization-rate map call did wrong (`Problem::RateMap`): what Metal's API validation +/// stops at `newRasterizationRateMapWithDescriptor:` (an M3 Max and an M4), and what ends Metal's +/// process at a reset or a coordinate map (the M3 Max under macOS 27.0.1). #[non_exhaustive] #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum RateMapProblem { @@ -73,11 +104,17 @@ pub enum RateMapProblem { /// A layer count past 2 ("layerCount (3) must be >0 and <=2"): the layers from index 0 up to /// the first without samples on an axis, the count Metal's descriptor answers. A count of 0, /// which Metal's validation also stops, makes a map of no layers, as plain Metal does (the - /// module docs). + /// module docs). At a reset, which Metal's validation does not check, such a count ends + /// Metal's process. LayerCount { /// The descriptor's layer count. count: usize, }, + /// A coordinate map of a map of no layers, which ends Metal's process. + NoLayers, + /// `mapPhysicalToScreenCoordinates:forLayer:` of a mutable map not yet reset, which ends + /// Metal's process. + NotCompiled, } /// A rasterization-rate map (`MTLRasterizationRateMap`). Cheap to clone (a retain); `Send + @@ -88,14 +125,174 @@ pub struct RasterizationRateMap(Arc); struct MapShared { device: Device, label: Option, - map: metal2vulkan::bind::RasterizationRateMap, - /// A map of no layers made after the device released a map of layers (the module docs). + mutability: Mutability, + /// What the map is now: a reset puts a new one in its place, so a pass keeps the one it took + /// (`rate_mapped_pass.rs`). + state: Mutex>, +} + +/// What a map is at one time (the module docs). +pub(super) struct MapState { + shape: Shape, + /// Each layer's physical width below 2 as the map holds it: a layer the map lacks keeps the + /// width an earlier compile gave it, 0 where none did. + widths: [u32; 2], + /// A map of no layers made after its device released a map of layers, or reset from layers: + /// one whose passes Metal draws from the memory they left (the module docs). after_release: bool, } +/// A map's compile, or a mutable map's descriptor's screen size and layer count before its first +/// reset. +enum Shape { + Compiled(metal2vulkan::bind::RasterizationRateMap), + Unset { screen_size: [u32; 2], layers: u32 }, +} + +impl MapState { + /// The compile layer's map, `None` for a mutable map not yet reset. + pub(super) fn compiled(&self) -> Option<&metal2vulkan::bind::RasterizationRateMap> { + match &self.shape { + Shape::Compiled(map) => Some(map), + Shape::Unset { .. } => None, + } + } + + /// `screenSize`'s width and height. + pub(super) fn screen_size(&self) -> [u32; 2] { + match &self.shape { + Shape::Compiled(map) => map.screen_size(), + Shape::Unset { screen_size, .. } => *screen_size, + } + } + + /// `layerCount`. + pub(super) fn layer_count(&self) -> u32 { + match &self.shape { + Shape::Compiled(map) => map.layer_count(), + Shape::Unset { layers, .. } => *layers, + } + } + + /// Whether every layer is the first's, so each slice is rasterized alike: a map not yet + /// reset rasterizes nothing in any. + pub(super) fn layers_alike(&self) -> bool { + match &self.shape { + Shape::Compiled(map) => { + (1..map.layer_count()).all(|layer| map.layer(layer) == map.layer(0)) + } + Shape::Unset { .. } => true, + } + } + + /// Whether its passes draw from the memory an earlier map left (the module docs). + pub(super) fn made_after_release(&self) -> bool { + self.after_release + } + + /// `physicalSizeForLayer:` (the module docs): a layer's physical width and height, depth 1; + /// past the layers, the width the map holds for it below layer 2 (else 0) and the vertical + /// extent the layers share; 0 by 0 at every layer of a map not yet reset. + pub(super) fn physical_size(&self, layer: u64) -> Size { + let Shape::Compiled(map) = &self.shape else { + return Size::new(0, 0, 1); + }; + if let Some([width, height]) = u32::try_from(layer).ok().and_then(|l| map.physical_size(l)) + { + return Size::new(width.into(), height.into(), 1); + } + let width = usize::try_from(layer) + .ok() + .and_then(|l| self.widths.get(l)) + .copied() + .unwrap_or(0); + Size::new(width.into(), map.vertical().physical_extent().into(), 1) + } + + /// The state of a fresh map of `descriptor`, the device having released a map of layers + /// where `released`: compiled, where Metal's API validation and the compile layer let it, but + /// for a `Mutable` one, which plain Metal makes of any descriptor (the module docs). + pub(super) fn made(descriptor: &RateMapDescriptor, released: bool) -> Result { + if descriptor.mutability == Mutability::Mutable { + return Ok(MapState { + shape: Shape::Unset { + screen_size: descriptor.screen_size, + layers: counted(descriptor) as u32, + }, + widths: [0; 2], + after_release: false, + }); + } + let map = compile(descriptor)?; + Ok(MapState::of(map, [0; 2], released)) + } + + /// The state of `map`, its widths below layer 2 over `earlier`'s, and of no layers drawing + /// from what an earlier map left where `after` (the module docs). + fn of( + map: metal2vulkan::bind::RasterizationRateMap, + mut widths: [u32; 2], + after: bool, + ) -> MapState { + for (layer, width) in widths.iter_mut().enumerate() { + if let Some([held, _]) = map.physical_size(layer as u32) { + *width = held; + } + } + MapState { + after_release: map.layer_count() == 0 && after, + shape: Shape::Compiled(map), + widths, + } + } + + /// The parameter data's words as the map holds them: 24,624 zero bytes before a mutable + /// map's first reset. + pub(super) fn words(&self) -> std::borrow::Cow<'_, [u32]> { + match &self.shape { + Shape::Compiled(map) => std::borrow::Cow::Borrowed(map.words()), + Shape::Unset { .. } => std::borrow::Cow::Owned(vec![0; WORDS]), + } + } + + /// The state a reset to `descriptor` leaves a map of this state in, the device having + /// released a map of layers where `released` (the module docs): `descriptor` compiled over + /// its tables, its widths kept past the new layers. Refused where Metal ends the process, a + /// layer count past 2, and where the compile layer does not compile it. + pub(super) fn reset( + &self, + descriptor: &RateMapDescriptor, + released: bool, + ) -> Result { + let count = counted(descriptor); + if count as u64 > RATE_MAP_LAYERS { + return Err(invalid( + "reset_using_descriptor", + Problem::RateMap(RateMapProblem::LayerCount { count }), + )); + } + let map = compile_over(descriptor, Some(&self.words()))?; + let after = self.compiled().is_some_and(|map| map.layer_count() > 0) + || self.after_release + || released; + Ok(MapState::of(map, self.widths, after)) + } +} + +/// `physicalGranularity`'s width and height, every map's: Metal's parameter data holds a line per +/// 32 pixels, compiled or not (the M3 Max under macOS 27.0.1). +const GRANULARITY: u64 = 32; + +/// The parameter data's 32-bit words. +const WORDS: usize = (metal2vulkan::bind::RasterizationRateMap::PARAMETER_DATA_SIZE / 4) as usize; + impl Drop for MapShared { fn drop(&mut self) { - if self.map.layer_count() > 0 { + let layered = self + .state + .get_mut() + .is_ok_and(|state| state.compiled().is_some_and(|map| map.layer_count() > 0)); + if layered { self.device .shared() .layered_rate_map_released @@ -106,10 +303,13 @@ impl Drop for MapShared { impl std::fmt::Debug for RasterizationRateMap { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let state = self.state(); f.debug_struct("RasterizationRateMap") .field("label", &self.0.label) - .field("screen_size", &self.0.map.screen_size()) - .field("layer_count", &self.0.map.layer_count()) + .field("mutability", &self.0.mutability) + .field("screen_size", &state.screen_size()) + .field("layer_count", &state.layer_count()) + .field("compiled", &state.compiled().is_some()) .finish() } } @@ -125,43 +325,62 @@ impl Eq for RasterizationRateMap {} impl Device { /// `newRasterizationRateMapWithDescriptor:` (the module docs): refused `Invalid` where Metal's /// API validation stops the descriptor, and `Error::RateMap` where the compile layer does not - /// compile it. + /// compile it. A `Mutable` descriptor's map is made of any descriptor, as plain Metal makes + /// it, and compiled at its first reset. pub fn new_rasterization_rate_map( &self, descriptor: &RateMapDescriptor, ) -> Result { - let map = compile(descriptor)?; - if !map.is_identity() { - self.degrade(Degradation::RasterizationRateMap, || { - let [width, height] = map.screen_size(); - ( - format!("a rasterization rate map of {width} by {height} screen pixels"), - "a render pass over it draws by regions whose lines are its tiles' exact \ - lines, where Apple's are its fixed-point ones; its \ - parameter data and coordinate maps are Metal's" - .to_owned(), - ) - }); - } - let after_release = map.layer_count() == 0 - && self - .shared() - .layered_rate_map_released - .load(Ordering::Relaxed); + let released = self + .shared() + .layered_rate_map_released + .load(Ordering::Relaxed); + let state = MapState::made(descriptor, released)?; + degrade_compiled(self, &state); Ok(RasterizationRateMap(Arc::new(MapShared { device: self.clone(), label: descriptor.label.clone(), - map, - after_release, + mutability: descriptor.mutability, + state: Mutex::new(Arc::new(state)), }))) } } -/// The compile layer's map of `descriptor`, or why Metal's API validation (`Invalid`) or the -/// compile layer (`Error::RateMap`) stops it (the module docs). -pub(super) fn compile( - descriptor: &RateMapDescriptor, -) -> Result { +/// Announce that a pass over the map `state` holds draws by regions of this crate's lines, where +/// it is not the identity (the module docs). +fn degrade_compiled(device: &Device, state: &MapState) { + let Some(map) = state.compiled() else { + return; + }; + if map.is_identity() { + return; + } + device.degrade(Degradation::RasterizationRateMap, || { + let [width, height] = map.screen_size(); + ( + format!("a rasterization rate map of {width} by {height} screen pixels"), + "a render pass over it draws by regions whose lines are its tiles' exact lines, where \ + Apple's are its fixed-point ones, and a mutable map's pass, which Metal rasterizes \ + past the screen's edge along its last tiles' lines, stops at the map's physical \ + size; its parameter data and coordinate maps are Metal's" + .to_owned(), + ) + }); +} + +/// Metal's `layerCount` of `descriptor`: its layers up to the first without samples on an axis, +/// which Metal's descriptor holds as nil. +fn counted(descriptor: &RateMapDescriptor) -> usize { + descriptor + .layers + .iter() + .take_while(|layer| !(layer.horizontal.is_empty() || layer.vertical.is_empty())) + .count() +} + +/// What Metal's API validation stops at `newRasterizationRateMapWithDescriptor:` (the module +/// docs), which the runtime refuses of a map compiled at creation. +fn validate(descriptor: &RateMapDescriptor) -> Result<(), Error> { const CALL: &str = "new_rasterization_rate_map"; let refused = |problem| invalid(CALL, Problem::RateMap(problem)); let [width, height] = descriptor.screen_size; @@ -169,15 +388,30 @@ pub(super) fn compile( if !extent.contains(&width) || !extent.contains(&height) { return Err(refused(RateMapProblem::ScreenSize { width, height })); } - // Metal's `layerCount`: a layer without samples on an axis is nil, and the count stops there. - let count = descriptor - .layers - .iter() - .take_while(|layer| !(layer.horizontal.is_empty() || layer.vertical.is_empty())) - .count(); + let count = counted(descriptor); if count as u64 > RATE_MAP_LAYERS { return Err(refused(RateMapProblem::LayerCount { count })); } + Ok(()) +} + +/// The compile layer's map of `descriptor`, or why Metal's API validation (`Invalid`) or the +/// compile layer (`Error::RateMap`) stops it (the module docs). +pub(super) fn compile( + descriptor: &RateMapDescriptor, +) -> Result { + validate(descriptor)?; + compile_over(descriptor, None) +} + +/// The compile layer's map of `descriptor`, Metal's layers of it, written over `earlier`'s words +/// where given (`metal2vulkan::bind::RasterizationRateMap::new_over`): `Error::RateMap` where the +/// compile layer does not compile it, a screen side of 0 or past its bound among them. +fn compile_over( + descriptor: &RateMapDescriptor, + earlier: Option<&[u32]>, +) -> Result { + let count = counted(descriptor); let counted; let descriptor = if count == descriptor.layers.len() { descriptor @@ -187,22 +421,25 @@ pub(super) fn compile( counted = kept; &counted }; - metal2vulkan::bind::RasterizationRateMap::new(descriptor).map_err(|error| match error { + let made = match earlier { + None => metal2vulkan::bind::RasterizationRateMap::new(descriptor), + Some(words) => metal2vulkan::bind::RasterizationRateMap::new_over(descriptor, words), + }; + made.map_err(|error| match error { RateMapError::Unpinned { reason } => Error::RateMap(reason), + RateMapError::ScreenExtent { extent } => { + Error::RateMap(UnpinnedCompile::ScreenExtent { extent }) + } other => internal(&format!( - "the compile layer refused a rate map Metal's validation takes: {other}" + "the compile layer refused a rate map Metal compiles: {other}" )), }) } -/// `physicalSizeForLayer:` of `map`: the layer's physical width and height, depth 1; past the -/// layers (every layer of a map of none), width 0 and the vertical extent the layers share (the -/// module docs). +/// `physicalSizeForLayer:` of a fresh map compiled as `map` (the module docs). +#[cfg(test)] pub(super) fn physical_size(map: &metal2vulkan::bind::RasterizationRateMap, layer: u64) -> Size { - match u32::try_from(layer).ok().and_then(|l| map.physical_size(l)) { - Some([width, height]) => Size::new(width.into(), height.into(), 1), - None => Size::new(0, map.vertical().physical_extent().into(), 1), - } + MapState::of(map.clone(), [0; 2], false).physical_size(layer) } /// A layer index as the compile layer's coordinate maps take it: one past `u32` reads the last @@ -217,89 +454,112 @@ impl RasterizationRateMap { &self.0.device } - /// Whether the map has no layers and was made after its device released a map of layers: - /// one whose passes Metal may draw from the released map's memory (the module docs). - pub(super) fn made_after_release(&self) -> bool { - self.0.after_release + /// What the map is now, which a pass takes as its encoder opens (`rate_mapped_pass.rs`). + pub(super) fn state(&self) -> Arc { + Arc::clone(&lock(&self.0.state)) } - /// The compile layer's map, which a rate-mapped pass plans its draws with - /// (`rate_mapped_pass.rs`). - pub(super) fn compiled(&self) -> &metal2vulkan::bind::RasterizationRateMap { - &self.0.map + /// The map's identity among the device's, while a handle of it lives. + pub(super) fn id(&self) -> usize { + Arc::as_ptr(&self.0) as usize } - /// `label`: the descriptor's. + /// Whether `state` is what the map is now: a pass that took another was planned by a map + /// since reset (`rate_mapped_pass.rs`). + pub(super) fn holds(&self, state: &Arc) -> bool { + Arc::ptr_eq(&lock(&self.0.state), state) + } + + /// `label`: the descriptor's it was made with; a reset keeps it. pub fn label(&self) -> Option<&str> { self.0.label.as_deref() } + /// `mutability` (Apple's private property): the descriptor's it was made with; a reset keeps + /// it. A `Mutable` map is compiled only at its first reset (the module docs). + pub fn mutability(&self) -> Mutability { + self.0.mutability + } + /// `screenSize`: the descriptor's width and height, depth 1 (as Metal answers on an M3 Max /// and an M4, where its header says 0). pub fn screen_size(&self) -> Size { - let [width, height] = self.0.map.screen_size(); + let [width, height] = self.state().screen_size(); Size::new(width.into(), height.into(), 1) } /// `physicalGranularity`: the physical width and height of every tile but each axis's last, - /// 32 by 32, depth 1. + /// 32 by 32, depth 1, for every map. pub fn physical_granularity(&self) -> Size { - let [width, height] = self.0.map.physical_granularity(); - Size::new(width.into(), height.into(), 1) + Size::new(GRANULARITY, GRANULARITY, 1) } - /// `layerCount`. + /// `layerCount`: the compiled map's, or a mutable map's descriptor's before its first reset. pub fn layer_count(&self) -> u64 { - self.0.map.layer_count().into() + self.state().layer_count().into() } /// `parameterBufferSizeAndAlign`: 24,624 bytes, aligned to 4, Metal's for every map. pub fn parameter_buffer_size_and_align(&self) -> SizeAndAlign { SizeAndAlign { - size: self.0.map.parameter_data_size(), + size: metal2vulkan::bind::RasterizationRateMap::PARAMETER_DATA_SIZE, align: metal2vulkan::bind::RasterizationRateMap::PARAMETER_DATA_ALIGNMENT, } } - /// `physicalSizeForLayer:` (`physical_size`). + /// `physicalSizeForLayer:` (the module docs). pub fn physical_size_for_layer(&self, layer: u64) -> Size { - physical_size(&self.0.map, layer) + self.state().physical_size(layer) } /// `mapScreenToPhysicalCoordinates:forLayer:`: where `screen` lands in the layer's physical - /// space, as Apple's CPU map answers it, bit for bit. A layer past the map's reads the last; - /// over a map of no layers, 0 across (the module docs). + /// space, as Apple's CPU map answers it, bit for bit; a layer past the map's reads the last. + /// (0, 0) before a mutable map's first reset. Refused, `Invalid` with + /// [`RateMapProblem::NoLayers`], over a map of no layers, where Metal's ends the process. pub fn map_screen_to_physical_coordinates( &self, screen: Coordinate2D, layer: u64, - ) -> Coordinate2D { - let [x, y] = self - .0 - .map - .screen_to_physical([screen.x, screen.y], layer_index(layer)); - Coordinate2D::new(x, y) + ) -> Result { + let state = self.state(); + let Some(map) = state.compiled() else { + return Ok(Coordinate2D::new(0.0, 0.0)); + }; + if map.layer_count() == 0 { + return Err(invalid( + "map_screen_to_physical_coordinates", + Problem::RateMap(RateMapProblem::NoLayers), + )); + } + let [x, y] = map.screen_to_physical([screen.x, screen.y], layer_index(layer)); + Ok(Coordinate2D::new(x, y)) } /// `mapPhysicalToScreenCoordinates:forLayer:`: the screen coordinate of `physical` in the - /// layer, as Apple's CPU map answers it, bit for bit. A layer past the map's reads the last; - /// over a map of no layers, 0 across (the module docs). + /// layer, as Apple's CPU map answers it, bit for bit; a layer past the map's reads the last. + /// Refused where Metal's ends the process, `Invalid` with [`RateMapProblem`]: over a map of no + /// layers (`NoLayers`), and before a mutable map's first reset (`NotCompiled`). pub fn map_physical_to_screen_coordinates( &self, physical: Coordinate2D, layer: u64, - ) -> Coordinate2D { - let [x, y] = self - .0 - .map - .physical_to_screen([physical.x, physical.y], layer_index(layer)); - Coordinate2D::new(x, y) + ) -> Result { + const CALL: &str = "map_physical_to_screen_coordinates"; + let state = self.state(); + let Some(map) = state.compiled() else { + return Err(invalid(CALL, Problem::RateMap(RateMapProblem::NotCompiled))); + }; + if map.layer_count() == 0 { + return Err(invalid(CALL, Problem::RateMap(RateMapProblem::NoLayers))); + } + let [x, y] = map.physical_to_screen([physical.x, physical.y], layer_index(layer)); + Ok(Coordinate2D::new(x, y)) } /// `copyParameterDataToBuffer:offset:`: Metal's parameter data, written at `offset` of - /// `buffer` through its mapping (the module docs). Refused for a buffer of another device - /// (`ForeignObject`), a `Private` one (`StorageMode`), and a write past its length - /// (`RangeOutOfBounds`). + /// `buffer` through its mapping (the module docs); 24,624 zeros before a mutable map's first + /// reset. Refused for a buffer of another device (`ForeignObject`), a `Private` one + /// (`StorageMode`), and a write past its length (`RangeOutOfBounds`). pub fn copy_parameter_data_to_buffer(&self, buffer: &Buffer, offset: u64) -> Result<(), Error> { const CALL: &str = "copy_parameter_data_to_buffer"; if !buffer.device().same(&self.0.device) { @@ -308,8 +568,9 @@ impl RasterizationRateMap { let Some(contents) = buffer.contents() else { return Err(invalid(CALL, Problem::StorageMode)); }; - let bytes = self.0.map.to_bytes(); - let size = bytes.len() as u64; + let state = self.state(); + let words = state.words(); + let size = metal2vulkan::bind::RasterizationRateMap::PARAMETER_DATA_SIZE; let length = buffer.length(); if offset.checked_add(size).is_none_or(|end| end > length) { return Err(invalid( @@ -321,6 +582,7 @@ impl RasterizationRateMap { }, )); } + let bytes: Vec = words.iter().flat_map(|word| word.to_le_bytes()).collect(); // SAFETY: the buffer's mapping holds its `length` bytes from `contents`, and // `offset + size` is at most that. A command that reads or writes those bytes meanwhile // races, as on Metal. @@ -333,4 +595,33 @@ impl RasterizationRateMap { }; Ok(()) } + + /// `resetUsingDescriptor:` (Apple's private call, the module docs): `descriptor` compiled + /// into the map over the tables it holds, its label and mutability kept. Refused where Metal + /// ends the process, a layer count past 2 (`Invalid` with [`RateMapProblem::LayerCount`]), + /// and, `Error::RateMap`, where the compile layer does not compile it (a screen side of 0, + /// which Metal's validation does not look at here, among them); the map is then as it was. + /// A pass that took the map before the reset and whose command buffer is not yet submitted + /// draws by the map as reset, as Metal's GPU reads it (`rate_mapped_pass.rs`). + pub fn reset_using_descriptor(&self, descriptor: &RateMapDescriptor) -> Result<(), Error> { + let device = &self.0.device; + let released = device + .shared() + .layered_rate_map_released + .load(Ordering::Relaxed); + let state = Arc::new(self.state().reset(descriptor, released)?); + degrade_compiled(device, &state); + // In place under the lock a submission reads its mark under: each command buffer + // committed and not yet submitted whose pass took the map is encoded again now, on this + // thread, as a rebind's are (`command_buffer/reencode.rs`); one not yet committed is at + // its commit. + let again = device + .shared() + .rebinds + .reset_map(self.id(), || *lock(&self.0.state) = state); + for buffer in again { + buffer.reencode(); + } + Ok(()) + } } diff --git a/crates/metal2vulkan-runtime/src/rate_mapped_pass.rs b/crates/metal2vulkan-runtime/src/rate_mapped_pass.rs index 1a4d08cd9..5cab57725 100644 --- a/crates/metal2vulkan-runtime/src/rate_mapped_pass.rs +++ b/crates/metal2vulkan-runtime/src/rate_mapped_pass.rs @@ -52,17 +52,47 @@ //! platform". A scissor that holds the viewport's pixels clips nothing the viewport does not, so //! the plan takes none; one that cuts into the viewport over a map that is not the identity is //! refused, as the compile layer refuses it ([`RegionRefusal::Scissor`]). -//! - **A map of no layers**. Metal makes one where its API validation is off, and a pass over one -//! made while no map of layers has been released runs its load, clear, and store actions and its -//! draws write nothing (an M4, each in its own process three times: a full-screen triangle over a -//! cleared target of 8 and of 64 pixels, with and without a scissor, a map of 256 pixels over a -//! target of 8, beside a live map of one layer, and in a sequence of passes); the runtime records -//! none of its draws. Whether Metal runs such a draw's vertex function is not measured. A map of -//! no layers made after a map of layers was released draws on Metal, an M4 and an M3 Max alike: a -//! 64-pixel one over a 64-pixel target its physical rows 0 to 15 at full width, at the positions -//! of a pass with no map, whatever map was released. The runtime draws nothing there and -//! announces it: a draw over a map of no layers made after the device released a map of layers -//! announces `zero-layer-map-after-release`. +//! - **A map of no layers, and a mutable map not yet reset**. Metal makes a map of no layers +//! where its API validation is off, and a pass over one made while no map of layers has been +//! released runs its load, clear, and store actions and its draws write nothing (an M4, each in +//! its own process three times: a full-screen triangle over a cleared target of 8 and of 64 +//! pixels, with and without a scissor, a map of 256 pixels over a target of 8, beside a live map +//! of one layer, and in a sequence of passes); a pass over a mutable map not yet reset alike +//! (the M3 Max under macOS 27.0.1). Metal runs each draw's vertex function there (the M3 Max: +//! a vertex function counting its runs ran 3 times for a triangle, over a map made of no +//! layers, immutable or mutable, and over a mutable one not yet reset), so the runtime records +//! each draw through an empty scissor: its vertex function runs, and no fragment. A map of no +//! layers made after a map of layers was released, or reset from layers, draws on Metal, an M4 +//! and an M3 Max alike: a 64-pixel one over a 64-pixel target its physical rows 0 to 15 at full +//! width, at the positions of a pass with no map, whatever map was released. The runtime draws +//! nothing there and announces it: a draw over such a map announces +//! `zero-layer-map-after-release`. +//! - **A reset** (`RasterizationRateMap::reset_using_descriptor`). Metal's pass reads the map as +//! the GPU runs it (our probe `rm`, the M3 Max under macOS 27.0.1, each case in a process of its +//! own: a reset from the identity to half quality after the encoder was made, after its draw, +//! after `endEncoding`, after `commit` and after `commit` while the command buffer waited for an +//! event the CPU signalled after the reset each shaded the half-quality map's pixels; two passes +//! of one waiting command buffer, the first ended before a reset and both before a second, shaded +//! the second's; a reset after the command buffer completed changed nothing). The runtime plans +//! each draw by the map as its encoder took it as it opened, which the encoder notes +//! (`EncoderCore::take_rate_map`), and keeps the pass's log (`render/replay.rs`). A reset puts +//! the map's new state in place under the lock a submission reads its mark under, and marks each +//! committed command buffer whose last event group is not yet submitted and whose pass took the +//! map; their passes that took it are encoded again from their logs, in the reset's call, before +//! that submission (`command_buffer/reencode.rs`), and a command buffer not yet committed has +//! them encoded again at its commit. A group submitted before the reset draws by the map as its +//! passes took it: Metal's GPU, already reading, may do either. An encoder that kept no log (a +//! command predication's command buffer, an encoder opened while a buffer of the device was +//! detached, one that left work for a host step), or whose encoding again is refused (the pass +//! checked against the map as reset), draws by the map as it took it, announced +//! (`rate-map-reset-unencoded`). +//! - **A mutable map's pass past the screen** (the M3 Max under macOS 27.0.1, a quad far past the +//! clip volume): Metal rasterizes a pass over a `Mutable` map past the screen's edge along the +//! last tiles' lines, to a bound not found (a 64-pixel screen at half quality shaded 49 physical +//! columns of its 33, one at 0.75 shaded 64 of 54), where a pass over a map of any other +//! mutability stops at the physical size. An identity map's pass stopped at its physical size +//! in every case measured, mutable or not. The runtime's pass stops at the physical size, inside +//! the near-equivalent the map's compile announces (`rasterization-rate-map`). //! - **What the plan refuses** is `NotImplemented(RuntimeGap::RateMapRegions)`, naming the //! compile layer's reason ([`RegionRefusal`]): a viewport of no extent or a flipped one, a //! scissor as above, a plan past its bound or past the device's viewport limits, a pipeline whose @@ -72,13 +102,14 @@ use super::degradation::Degradation; use super::error::{internal, invalid, Error, Problem, RuntimeGap}; -use super::rate_map::RasterizationRateMap; +use super::rate_map::{MapState, RasterizationRateMap}; use super::render_pass::{PassLayout, RenderPassDescriptor, RenderPassProblem}; use super::render_values::{ScissorRect, Viewport}; use super::Device; use ash::vk; use metal2vulkan::bind::{RegionError, RegionLimits}; use metal2vulkan::pipeline::GraphicsState; +use std::sync::Arc; /// Why a draw in a rate-mapped pass is not drawn region by region: the compile layer's /// [`RegionError`](metal2vulkan::bind::RegionError), by kind (the module docs). @@ -113,6 +144,8 @@ pub enum RegionRefusal { #[derive(Clone)] pub(super) struct RateMappedPass { map: RasterizationRateMap, + /// The map as the encoder took it, which its draws are planned by. + state: Arc, area: [u32; 2], /// Every layer of the map is the first's: each slice is rasterized alike. alike: bool, @@ -132,12 +165,11 @@ pub(super) fn check_descriptor( if !map.device().same(device) { return Err(invalid(call, Problem::ForeignObject)); } - let compiled = map.compiled(); - let layers = compiled.layer_count(); + let state = map.state(); + let layers = state.layer_count(); // Past the layers of a map whose layers are alike every slice takes layer 0, as plain Metal // rasterizes past one layer (the module docs). - let alike = (1..layers).all(|layer| compiled.layer(layer) == compiled.layer(0)); - if descriptor.render_target_array_length > u64::from(layers) && !alike { + if descriptor.render_target_array_length > u64::from(layers) && !state.layers_alike() { return Err(invalid( call, Problem::RenderPass(RenderPassProblem::RateMapArrayLength { @@ -160,8 +192,8 @@ impl RateMappedPass { let Some(map) = &descriptor.rasterization_rate_map else { return Ok(None); }; - let compiled = map.compiled(); - let screen = compiled.screen_size(); + let state = map.state(); + let screen = state.screen_size(); let attached = layout.colors.iter().flatten().next().is_some() || layout.depth_stencil.is_some(); let area = if !attached { @@ -181,15 +213,19 @@ impl RateMappedPass { // render area cuts each region's scissor (the module docs). screen }; - let alike = - (1..compiled.layer_count()).all(|layer| compiled.layer(layer) == compiled.layer(0)); Ok(Some(RateMappedPass { map: map.clone(), + alike: state.layers_alike(), + state, area, - alike, })) } + /// The map and the map as the pass took it, which its encoder notes (`EncoderCore::take_rate_map`). + pub(super) fn taken(&self) -> (RasterizationRateMap, Arc) { + (self.map.clone(), Arc::clone(&self.state)) + } + /// Whether every layer of the map is the first's, so a draw rasterizes every slice alike /// whichever slices it renders (the module docs). pub(super) fn layers_alike(&self) -> bool { @@ -238,30 +274,43 @@ impl RateMappedPass { // Inside the area, which fits a `u32` (checked at the setter). [scissor.x, scissor.y, scissor.width, scissor.height].map(|v| v as u32) }); - // A map of no layers rasterizes nothing: the draw is not recorded. One made after the - // device released a map of layers is one Metal may draw from that map's memory: announced. - if self.map.compiled().layer_count() == 0 { - if self.map.made_after_release() { - self.map - .device() - .degrade(Degradation::ZeroLayerMapAfterRelease, || { - let [width, height] = self.map.compiled().screen_size(); - ( - format!( - "a render pass over a rasterization rate map of no layers, \ - {width} by {height} screen pixels, made after a map of layers \ - was released" - ), - "Metal draws such a pass (an Apple M4 and an Apple M3 Max drew a \ - 64-pixel map's rows 0 to 15 at the positions of a pass with no map, \ - whatever map was released); the runtime draws \ - nothing" - .to_owned(), - ) - }); + // A map not yet reset, and a map of no layers, rasterize nothing: the draw runs its vertex + // function alone, through an empty scissor, as Metal's does. One made, or reset, after a + // map of layers is one Metal draws from that map's memory: announced. + let compiled = match self.state.compiled() { + Some(map) if map.layer_count() > 0 => map, + compiled => { + if self.state.made_after_release() { + let [width, height] = self.state.screen_size(); + self.map + .device() + .degrade(Degradation::ZeroLayerMapAfterRelease, || { + ( + format!( + "a render pass over a rasterization rate map of no layers, \ + {width} by {height} screen pixels, made after a map of \ + layers was released, or reset from layers" + ), + "Metal draws such a pass (an Apple M4 and an Apple M3 Max drew \ + a 64-pixel map's rows 0 to 15 at the positions of a pass with \ + no map, whatever map was released); the runtime draws \ + nothing" + .to_owned(), + ) + }); + } + debug_assert!(compiled.is_none_or(|map| map.layer_count() == 0)); + let viewport = vk::Viewport { + x: 0.0, + y: 1.0, + width: 1.0, + height: -1.0, + min_depth: viewport.znear as f32, + max_depth: viewport.zfar as f32, + }; + return Ok(vec![(viewport, vk::Rect2D::default())]); } - return Ok(Vec::new()); - } + }; // Metal rasterizes each primitive by the map's layer of the slice it renders: the plan of // that slice's layer bounds a draw of one slice, and the first layer's any draw over a map // of layers alike; a draw whose primitives choose over layers that differ is refused as @@ -271,9 +320,7 @@ impl RateMappedPass { (Some(slice), false) => (slice, true), (None, false) => (0, false), }; - let plan = self - .map - .compiled() + let plan = compiled .regions(layer, guest, clip, limits) .and_then(|plan| { match bounded { @@ -348,3 +395,25 @@ fn refusal(error: RegionError) -> Error { }; Error::NotImplemented(RuntimeGap::RateMapRegions(kind)) } + +/// Announce, at the commit of its command buffer, that an encoder whose pass took a +/// rasterization-rate map since reset, and that kept no log (`unlogged` says why, where known), +/// draws by the map as it took it (the module docs). +pub(super) fn degrade_unencoded( + device: &Device, + unlogged: Option, +) { + device.degrade(Degradation::RateMapResetUnencoded, || { + let why = match unlogged { + Some(why) => format!(", not encoded again as {why}"), + None => String::new(), + }; + ( + format!( + "a render pass over a rasterization rate map reset after the pass took it{why}" + ), + "the pass draws by the map as it took it, where Metal's GPU draws by the map as reset" + .to_owned(), + ) + }); +} diff --git a/crates/metal2vulkan-runtime/src/rebind.rs b/crates/metal2vulkan-runtime/src/rebind.rs index 0dfc59feb..d6f6b0447 100644 --- a/crates/metal2vulkan-runtime/src/rebind.rs +++ b/crates/metal2vulkan-runtime/src/rebind.rs @@ -70,6 +70,7 @@ use super::heap::Heap; use super::host_memory::{Deallocator, HostMemory, HostRelease, KeepAlive}; use super::key_hash::KeyMap; use super::program_objects; +use super::rate_map::{MapState, RasterizationRateMap}; use super::resource::{ObjectId, ResourceKey}; use super::Device; use std::any::Any; @@ -130,6 +131,10 @@ pub(super) struct Rebinds { #[derive(Default)] struct Waiting { buffers: Vec<(Weak, Box<[ResourceKey]>)>, + /// The command buffers waiting so whose encoders' passes are over rasterization-rate maps, + /// with the maps' identities (`RasterizationRateMap::id`): a reset of one has those encoders + /// encoded again ([`Rebinds::reset_map`]). + maps: Vec<(Weak, Box<[usize]>)>, /// The length past which the next registration first lets go of the entries whose command /// buffer went or was submitted. prune_at: usize, @@ -144,7 +149,8 @@ impl Waiting { return; } self.buffers.retain(|(buffer, _)| buffer.strong_count() > 0); - self.prune_at = (2 * self.buffers.len()).max(16); + self.maps.retain(|(buffer, _)| buffer.strong_count() > 0); + self.prune_at = (2 * self.buffers.len().max(self.maps.len())).max(16); } } @@ -265,10 +271,16 @@ impl Rebinds { &self, buffer: &Arc, keys: Box<[ResourceKey]>, + maps: Box<[usize]>, ) { let mut waiting = lock(&self.waiting); waiting.prune(); - waiting.buffers.push((Arc::downgrade(buffer), keys)); + if !keys.is_empty() { + waiting.buffers.push((Arc::downgrade(buffer), keys)); + } + if !maps.is_empty() { + waiting.maps.push((Arc::downgrade(buffer), maps)); + } } /// `buffer` waits for no rebind's replay from here: its last event group was submitted, or @@ -278,6 +290,41 @@ impl Rebinds { waiting .buffers .retain(|(waiting, _)| !std::ptr::eq(Weak::as_ptr(waiting), buffer)); + waiting + .maps + .retain(|(waiting, _)| !std::ptr::eq(Weak::as_ptr(waiting), buffer)); + } + + /// Reset the rasterization-rate map of identity `map` by `swap`, which puts its new state in + /// place, under the lock a group's submission reads its mark under: the command buffers + /// waiting for the submission of an event group whose encoders' passes are over it + /// ([`Rebinds::wait_for_replay`]) are each marked to encode those encoders again before that + /// submission (`CommandBufferShared::reencode`), which the caller runs. So a group's + /// submission came either before the reset (and draws by the map as its passes took it, as + /// Metal's GPU, under way, read it) or waits for its passes encoded again. + pub(super) fn reset_map( + &self, + map: usize, + swap: impl FnOnce(), + ) -> Vec> { + let _submitting = lock(&self.buffers); + swap(); + let waiting = lock(&self.waiting); + let mut again: Vec> = Vec::new(); + let over = (waiting.maps.iter()) + .filter(|(_, maps)| maps.contains(&map)) + .map(|(buffer, _)| buffer); + for buffer in over { + let Some(buffer) = buffer.upgrade() else { + continue; + }; + if again.iter().any(|had| Arc::ptr_eq(had, &buffer)) { + continue; + } + buffer.mark_reencode(); + again.push(buffer); + } + again } /// Whether a buffer of the device is detached now (`detach.rs`): a render encoder logs no call @@ -681,6 +728,10 @@ pub(super) struct Taken { /// A command named a detached buffer, and the encoder recorded nothing from it on /// (`EncoderCore::skips`): its submission never runs. dead: bool, + /// The rasterization-rate map its render pass is over, and the map as the pass took it, + /// which its draws were planned by: a reset of the map before the submission of its event + /// group has the encoder encoded again (`rate_mapped_pass.rs`). + rate_map: Option<(RasterizationRateMap, Arc)>, } /// The objects of a releasable import a blit's command took (`Buffer::blit_at`, @@ -761,6 +812,33 @@ impl Taken { self.pins.extend(other.pins); self.named.extend(other.named); self.dead |= other.dead; + if self.rate_map.is_none() { + self.rate_map = other.rate_map; + } + } + + /// Note that the encoder's render pass is over `map`, which it took as `state`. + pub(super) fn take_rate_map(&mut self, map: RasterizationRateMap, state: Arc) { + self.rate_map = Some((map, state)); + } + + /// Whether a rebind or a reset may have the encoder encoded again: a command named a buffer + /// over host pages, or its pass is over a rasterization-rate map. + pub(super) fn encodes_again(&self) -> bool { + self.names_a_pin() || self.rate_map.is_some() + } + + /// The identity of the rasterization-rate map its pass is over (`Rebinds::reset_map`). + pub(super) fn rate_map_id(&self) -> Option { + self.rate_map.as_ref().map(|(map, _)| map.id()) + } + + /// Whether its pass took a rasterization-rate map since reset: its draws were planned by a + /// map Metal's GPU no longer reads (`rate_mapped_pass.rs`). + pub(super) fn rate_map_reset(&self) -> bool { + self.rate_map + .as_ref() + .is_some_and(|(map, state)| !map.holds(state)) } /// The encoder records nothing more: a command named a detached buffer. diff --git a/crates/metal2vulkan-runtime/src/render.rs b/crates/metal2vulkan-runtime/src/render.rs index 7648f0687..0dcfa4224 100644 --- a/crates/metal2vulkan-runtime/src/render.rs +++ b/crates/metal2vulkan-runtime/src/render.rs @@ -1668,14 +1668,13 @@ impl CommandBuffer { color_groups::check_twin(&full)?; } // Each later group runs the encoder's calls again from its log, which such a pass keeps - // whatever the device's rebinds. + // whatever the device's rebinds, as does a pass over a rasterization-rate map, which a + // reset of the map before its submission encodes again (`rate_mapped_pass.rs`). let log = match (&again, groups > 1) { (_, true) => Some(device.shared().scheduler.spare_logs().render(given)), - (None, false) => device - .shared() - .rebinds - .any() - .then(|| device.shared().scheduler.spare_logs().render(given)), + (None, false) => (device.shared().rebinds.any() + || given.rasterization_rate_map.is_some()) + .then(|| device.shared().scheduler.spare_logs().render(given)), (Some(_), false) => None, }; let projected; @@ -1719,6 +1718,10 @@ impl CommandBuffer { None => EncoderCore::open(self, CALL, EncoderKind::Render, false)?, Some(_) => EncoderCore::replaying(self, false)?, }; + if let Some(pass) = &rate_map { + let (map, state) = pass.taken(); + core.take_rate_map(map, state); + } // The whole pass, every group's colors. let whole = full.as_ref().unwrap_or(&layout); if let Some(error) = whole.fails_command_buffer { diff --git a/crates/metal2vulkan-runtime/src/render/unused_bits_load.rs b/crates/metal2vulkan-runtime/src/render/unused_bits_load.rs index a7de56839..e9f49daf0 100644 --- a/crates/metal2vulkan-runtime/src/render/unused_bits_load.rs +++ b/crates/metal2vulkan-runtime/src/render/unused_bits_load.rs @@ -16,7 +16,8 @@ //! values: every code of each tile it stores back goes through `half` to nearest even and back to //! the nearest bfloat code, a NaN to `0x7fc0` (`ExtendedRange::load_code`; on an Apple M4 //! under macOS 27.0.1, every code of each format: 56,829 move, and only in the tiles the draws' -//! primitives reach). The tiles it stores are those a draw's primitives reach (the half of a rect +//! primitives reach; the M3 Max under macOS 27.0.1 alike, our probe `bfl`: every code of the +//! tile a small triangle reached, of each format, and none elsewhere). The tiles it stores are those a draw's primitives reach (the half of a rect //! whose edge lies on x = 32 reaches the tiles right of it; a zero-area rect or one off the //! target reaches none), within the render area rounded up to 32 texels a side from the origin //! and kept within the texture; every tile of it where a color attachment of the pass is cleared @@ -523,9 +524,10 @@ pub(super) fn record( rewrites only the tiles a draw's primitives reach (or every tile where a \ color attachment is cleared): in tiles no draw reaches the unused bits are \ made canonical and BGRA10_XR alpha codes clamped to [384, 894], a padded \ - word's low six bits zeroed (an _sRGB twin's code through Metal's table) and, \ - under the exact tile store, a signed normalized minimum code raised and an \ - RGB9E5Float word normalized, where Metal keeps those texels' bytes" + word's low six bits zeroed (an _sRGB twin's code through Metal's table), a \ + bfloat code moved through half and, under the exact tile store, a signed \ + normalized minimum code raised and an RGB9E5Float word normalized, where \ + Metal keeps those texels' bytes" .to_owned(), ) }); diff --git a/crates/metal2vulkan-runtime/src/tests/degradation_codes.txt b/crates/metal2vulkan-runtime/src/tests/degradation_codes.txt index bf33a0aac..04bc15a26 100644 --- a/crates/metal2vulkan-runtime/src/tests/degradation_codes.txt +++ b/crates/metal2vulkan-runtime/src/tests/degradation_codes.txt @@ -157,6 +157,7 @@ metal2vulkan-degrade-quads-counted-before-discard metal2vulkan-degrade-quads-split-by-clipping metal2vulkan-degrade-rasterization-rate-map metal2vulkan-degrade-rate-map-parameter-data +metal2vulkan-degrade-rate-map-reset-unencoded metal2vulkan-degrade-read-only-pages-written metal2vulkan-degrade-reduction-order metal2vulkan-degrade-reissued-resource-id diff --git a/crates/metal2vulkan-runtime/src/tests/mod.rs b/crates/metal2vulkan-runtime/src/tests/mod.rs index 5c9626fb5..6d9dab6ef 100644 --- a/crates/metal2vulkan-runtime/src/tests/mod.rs +++ b/crates/metal2vulkan-runtime/src/tests/mod.rs @@ -166,6 +166,8 @@ mod recycle; mod released_programs; mod render; mod replays; +#[cfg(any(m2v_gpu, m2v_cpu_icd))] +mod rerun_arenas; mod resource; mod resource_ids; mod rotated; diff --git a/crates/metal2vulkan-runtime/src/tests/rate_map.rs b/crates/metal2vulkan-runtime/src/tests/rate_map.rs index 8817020b2..e4c0c457f 100644 --- a/crates/metal2vulkan-runtime/src/tests/rate_map.rs +++ b/crates/metal2vulkan-runtime/src/tests/rate_map.rs @@ -1,12 +1,13 @@ //! The rasterization-rate map's creation rules and answers that need no device -//! (`rate_map::compile`, `rate_map::physical_size`). +//! (`rate_map::compile`, `rate_map::physical_size`, `rate_map::MapState`). use super::super::error::{Error, Invalid, Problem}; -use super::super::rate_map::{compile, physical_size, RateMapProblem}; +use super::super::rate_map::{compile, physical_size, MapState, RateMapProblem}; use super::super::values::Size; use metal2vulkan::bind::{ RasterizationRateMap, RateMapDescriptor, RateMapLayerDescriptor, UnpinnedCompile, }; +use metal2vulkan::metal::Mutability; /// A descriptor of `width` by `height` screen pixels and these layers' samples. fn descriptor(width: u32, height: u32, layers: &[(&[f32], &[f32])]) -> RateMapDescriptor { @@ -127,3 +128,106 @@ fn a_layer_past_the_map_has_no_width_and_the_shared_height() { assert_eq!(physical_size(&empty, layer), Size::new(0, 16, 1), "{layer}"); } } + +/// A mutable map before its first reset answers as Metal's (our probe `rm`, the M3 Max under +/// macOS 27.0.1): its descriptor's screen and layer count, a physical size of 0 by 0 at every +/// layer, and parameter data of zeros. Its reset compiles the descriptor given as a fresh map of +/// it would be, and a map of another mutability is compiled at once. +#[test] +fn a_mutable_map_is_compiled_at_its_reset() { + let mut mutable = descriptor(256, 128, &[(&[0.1], &[0.1])]); + mutable.mutability = Mutability::Mutable; + let unset = MapState::made(&mutable, false).unwrap(); + assert!(unset.compiled().is_none()); + assert_eq!(unset.screen_size(), [256, 128]); + assert_eq!(unset.layer_count(), 1); + for layer in [0, 1, 2, u64::MAX] { + assert_eq!(unset.physical_size(layer), Size::new(0, 0, 1), "{layer}"); + } + assert!(unset.words().iter().all(|&word| word == 0)); + assert_eq!(unset.words().len(), 24_624 / 4); + let plain = descriptor(256, 128, &[(&[0.1], &[0.1])]); + let reset = unset.reset(&plain, false).unwrap(); + let fresh = MapState::made(&plain, false).unwrap(); + assert_eq!(reset.compiled(), fresh.compiled()); + assert_eq!(reset.physical_size(0), Size::new(32, 16, 1)); + // Plain Metal makes a mutable map of a descriptor its API validation stops. + for (screen, layers) in [([64, 64], 3), ([0, 64], 1), ([40000, 64], 1)] { + let mut stopped = descriptor(screen[0], screen[1], &[HALF; 3][..layers]); + stopped.mutability = Mutability::Mutable; + let unset = MapState::made(&stopped, false).unwrap(); + assert_eq!(unset.screen_size(), screen); + assert_eq!(unset.layer_count(), layers as u32); + assert_eq!(unset.physical_size(0), Size::new(0, 0, 1)); + let reset = unset.reset(&plain, false).unwrap(); + assert_eq!(reset.compiled(), fresh.compiled()); + } + for mutability in [Mutability::Default, Mutability::Immutable] { + let mut d = plain.clone(); + d.mutability = mutability; + assert_eq!( + MapState::made(&d, false).unwrap().compiled(), + fresh.compiled(), + "{mutability:?}" + ); + } +} + +/// A reset refuses what ends Metal's process, three layers, and what the compile layer does not +/// compile, a screen side of 0 among them (Metal's validation does not look at a reset), leaving +/// nothing changed. +#[test] +fn a_reset_refuses_what_metal_or_the_compile_stops() { + let map = MapState::made(&descriptor(64, 64, &[HALF]), false).unwrap(); + assert_eq!( + map.reset(&descriptor(64, 64, &[HALF; 3]), false).err(), + Some(Error::Invalid(Invalid::new( + "reset_using_descriptor", + Problem::RateMap(RateMapProblem::LayerCount { count: 3 }), + ))) + ); + for (width, height, extent) in [ + (0, 64, 0), + (64, 0, 0), + (16385, 64, 16385), + (70000, 64, 70000), + ] { + assert_eq!( + map.reset(&descriptor(width, height, &[HALF]), false).err(), + Some(Error::RateMap(UnpinnedCompile::ScreenExtent { extent })), + "{width}x{height}" + ); + } +} + +/// A map reset to fewer layers keeps the physical width each layer below 2 held, at the reset's +/// vertical extent, as Metal answers (our probe `none`, the M3 Max under macOS 27.0.1: maps of +/// 100 by 60 screen pixels, one layer of quality 1 and of 0.5, and two of 0.5 and 0.25, reset to +/// no layers over 64 by 32). Past layer 1 Metal reads past its table (16 at layer 2); the +/// runtime answers width 0 there. A map reset to none after layers draws from what they left. +#[test] +fn a_reset_keeps_the_widths_past_its_layers() { + let none = descriptor(64, 32, &[]); + for (layers, widths) in [ + (&[(&[1.0][..], &[1.0][..])][..], [100, 0]), + (&[HALF], [64, 0]), + (&[HALF, (&[0.25], &[0.25])], [64, 32]), + ] { + let earlier = MapState::made(&descriptor(100, 60, layers), false).unwrap(); + let reset = earlier.reset(&none, false).unwrap(); + assert_eq!(reset.layer_count(), 0); + for (layer, width) in widths.into_iter().enumerate() { + assert_eq!( + reset.physical_size(layer as u64), + Size::new(width, 16, 1), + "{widths:?} at {layer}" + ); + } + assert_eq!(reset.physical_size(2), Size::new(0, 16, 1)); + assert!(reset.made_after_release()); + } + let fresh = MapState::made(&none, false).unwrap(); + assert!(!fresh.made_after_release()); + assert!(MapState::made(&none, true).unwrap().made_after_release()); + assert_eq!(fresh.physical_size(0), Size::new(0, 16, 1)); +} diff --git a/crates/metal2vulkan-runtime/src/tests/rerun_arenas.rs b/crates/metal2vulkan-runtime/src/tests/rerun_arenas.rs new file mode 100644 index 000000000..8c0e4e0cb --- /dev/null +++ b/crates/metal2vulkan-runtime/src/tests/rerun_arenas.rs @@ -0,0 +1,194 @@ +//! A predicated loop's runs again (`command_buffer/rerun.rs`) record the work its laying left +//! apart with descriptor sets and uploads of the check's own arenas, let go once each run +//! completed: the command buffer's own upload arena holds no more after forty runs than after +//! three, and a descriptor arena lent so takes every set, its pools reset and taken again run +//! after run. +//! +//! A device test: compiled only under the validation crate's GPU safety cfgs (`m2v_gpu`, +//! `m2v_cpu_icd`), on the kind of device the cfg selects. The kernel is `scale_and_offset` of the +//! owned fixture `validation/fixtures/public/examples/runtime_examples.ll` (`llvm-as`): +//! `output[i] = input[i] * scale + i`. + +use crate::descriptor_arena::{DescriptorArena, SetNeeds}; +use crate::device::lock; +use crate::{ + CommandBufferStatus, ComputePipelineState, Device, DeviceKind, DeviceOptions, + IndirectCommandBufferDescriptor, PipelineOptions, ResourceOptions, Size, +}; +use ash::vk; +use metal2vulkan::metal::{IndirectCommandType, ResourceUsage}; +use metal2vulkan::pipeline::{ComputePipelineDescriptor, StageSource}; +use std::path::Path; +use std::sync::{Arc, Mutex}; +use std::time::{Duration, Instant}; + +/// The longest the test waits for the loop's runs again, and for its command buffer. +const WAIT: Duration = Duration::from_secs(60); + +/// The threads each dispatch runs. +const COUNT: u32 = 1000; + +/// The device the cfg selects: a CPU device under `m2v_cpu_icd`, else a GPU. +fn device() -> Device { + let options = DeviceOptions { + kinds: match cfg!(m2v_cpu_icd) { + true => vec![DeviceKind::Cpu], + false => vec![ + DeviceKind::Discrete, + DeviceKind::Integrated, + DeviceKind::Virtual, + ], + }, + ..DeviceOptions::default() + }; + Device::system_default_with(&options).unwrap() +} + +/// A state of the fixture's `scale_and_offset` that an indirect command buffer's commands may +/// set. +fn state(device: &Device) -> ComputePipelineState { + let ll = Path::new(env!("CARGO_MANIFEST_DIR")) + .join("../metal2vulkan-validation/fixtures/public/examples/runtime_examples.ll"); + let bitcode = metal2vulkan_devtools::llvm_assemble(&ll).unwrap(); + let library = metal2vulkan::library::Library::from_air(&bitcode).unwrap(); + let library = device.new_library_with_compile_library(library); + let function = library.new_function_with_name("scale_and_offset").unwrap(); + let mut descriptor = + ComputePipelineDescriptor::new(StageSource::Function(function.function_descriptor())); + descriptor.support_indirect_command_buffers = true; + device + .new_compute_pipeline_state(&descriptor, &PipelineOptions::default()) + .unwrap() +} + +/// The little-endian bytes of `words`. +fn bytes(words: &[u32]) -> Vec { + words.iter().flat_map(|word| word.to_le_bytes()).collect() +} + +/// A DoWhile whose body is work the runtime records apart, which each run again records again (a +/// dispatch from GPU arguments, which a host step reads, and an indirect command buffer's +/// execution), and whose condition holds until the host writes its word, runs again and again; +/// meanwhile the command buffer's upload arena stays as it was after its third run again. Once +/// the word is written the loop ends and the command buffer completes, the output written. +#[test] +fn a_loop_run_again_holds_no_more_uploads_each_run() { + let device = device(); + let state = state(&device); + let shared = ResourceOptions::shared(); + let input: Vec = (0..COUNT).flat_map(|i| (i as f32).to_le_bytes()).collect(); + let input = device.new_buffer_with_bytes(&input, shared).unwrap(); + let output = device.new_buffer(u64::from(COUNT) * 4, shared).unwrap(); + let scale = device + .new_buffer_with_bytes(&2.0f32.to_le_bytes(), shared) + .unwrap(); + let arguments = bytes(&[COUNT, 1, 1, 64, 1, 1]); + let arguments = device.new_buffer_with_bytes(&arguments, shared).unwrap(); + let word = device.new_buffer(16, shared).unwrap(); + let mut descriptor = IndirectCommandBufferDescriptor::new(); + descriptor.command_types = IndirectCommandType::CONCURRENT_DISPATCH_THREADS; + descriptor.max_kernel_buffer_bind_count = 3; + let icb = device + .new_indirect_command_buffer(&descriptor, 1, shared) + .unwrap(); + let command = icb.indirect_compute_command_at(0).unwrap(); + command.set_compute_pipeline_state(&state).unwrap(); + for (index, buffer) in (0..).zip([&input, &output, &scale]) { + command.set_kernel_buffer(Some(buffer), 0, index).unwrap(); + } + let (grid, group) = (Size::new(u64::from(COUNT), 1, 1), Size::new(64, 1, 1)); + command.concurrent_dispatch_threads(grid, group).unwrap(); + let queue = device.new_command_queue().unwrap(); + let command_buffer = queue.command_buffer().unwrap(); + let mut encoder = command_buffer.compute_command_encoder().unwrap(); + encoder.set_compute_pipeline_state(&state).unwrap(); + for (index, buffer) in (0..).zip([&input, &output, &scale]) { + encoder.set_buffer(Some(buffer), 0, index).unwrap(); + } + let resources = [ + input.as_resource(), + output.as_resource(), + scale.as_resource(), + ]; + let usage = ResourceUsage::READ | ResourceUsage::WRITE; + encoder.use_resources(&resources, usage).unwrap(); + encoder.encode_start_do_while().unwrap(); + encoder.dispatch_threads_indirect(&arguments, 0).unwrap(); + encoder.execute_commands_in_buffer(&icb, 0..1).unwrap(); + // Again while word 0 is 0 (Metal's code 0, `==`). + let end = encoder.encode_end_do_while(Some(&word), 0, 0, 0); + assert_eq!(end, Ok(true)); + encoder.end_encoding().unwrap(); + let before = device.work_counts().predicated_loop_runs_again; + command_buffer.commit().unwrap(); + let ran_again = |runs: u64| { + let deadline = Instant::now() + WAIT; + while device.work_counts().predicated_loop_runs_again < before + runs { + assert!(Instant::now() < deadline, "fewer than {runs} runs again"); + std::thread::sleep(Duration::from_millis(1)); + } + }; + ran_again(3); + let early = command_buffer.upload_bytes(); + ran_again(40); + let late = command_buffer.upload_bytes(); + let contents = word.contents().unwrap(); + // SAFETY: the word's first 4 bytes; the GPU only reads them. + unsafe { contents.as_ptr().cast::().write_volatile(1) }; + command_buffer.wait_until_completed_for(WAIT).unwrap(); + assert_eq!(command_buffer.status(), CommandBufferStatus::Completed); + assert_eq!( + late, + early, + "the upload arena grew by {} bytes over 37 runs again", + late.saturating_sub(early) + ); + let contents = output.contents().unwrap(); + // SAFETY: the output's first words, which no command buffer writes now. + let words = unsafe { std::slice::from_raw_parts(contents.as_ptr().cast::(), 4) }; + assert_eq!(words, [0.0, 3.0, 6.0, 9.0]); +} + +/// A descriptor arena lent another (`DescriptorArena::lend`, as a run again's work apart records) +/// allocates every set from the lent one and opens no pool of its own; the lent one's pools, +/// reset after each of twenty runs of forty sets (`DescriptorArena::reset`, as each run again +/// completed), take every later run's sets: the pools the first run opened are all it ever opens. +#[test] +fn a_lent_descriptor_arena_takes_every_set_and_its_reset_opens_no_pool() { + let device = device(); + let raw = device.shared().vk(); + let bindings = [vk::DescriptorSetLayoutBinding::default() + .binding(0) + .descriptor_type(vk::DescriptorType::STORAGE_BUFFER) + .descriptor_count(1) + .stage_flags(vk::ShaderStageFlags::COMPUTE)]; + let info = vk::DescriptorSetLayoutCreateInfo::default().bindings(&bindings); + // SAFETY: `info` is live for the call. + let layout = unsafe { raw.create_descriptor_set_layout(&info, None) }.unwrap(); + let needs = SetNeeds { + counts: vec![(vk::DescriptorType::STORAGE_BUFFER.as_raw(), 1)], + flags: vk::DescriptorPoolCreateFlags::empty(), + }; + let mut own = DescriptorArena::default(); + let lent = Arc::new(Mutex::new(DescriptorArena::default())); + own.lend(Some(Arc::clone(&lent))); + let mut opened = None; + for run in 0..20 { + for _ in 0..40 { + own.allocate(&device, layout, &needs).unwrap(); + } + assert_eq!( + own.pools(), + 0, + "run {run}: a set from the arena's own pools" + ); + let made = device.work_counts().arena_pools_made; + assert_eq!(*opened.get_or_insert(made), made, "run {run} opened a pool"); + lock(&lent).reset().unwrap(); + } + own.lend(None); + assert!(lock(&lent).pools() > 0); + drop(lent); + // SAFETY: no set of the layout is in use, and its arenas' pools are gone. + unsafe { raw.destroy_descriptor_set_layout(layout, None) }; +} diff --git a/crates/metal2vulkan-runtime/src/tests/view_plan.rs b/crates/metal2vulkan-runtime/src/tests/view_plan.rs index 04d48e657..7317faf1b 100644 --- a/crates/metal2vulkan-runtime/src/tests/view_plan.rs +++ b/crates/metal2vulkan-runtime/src/tests/view_plan.rs @@ -777,17 +777,19 @@ fn a_view_keeps_its_images_components_of_one_count_and_width() { assert_eq!(refused.needs, Needs::NotRepresentable); } -/// A two-plane YCbCr texture viewed in its own format or its `_sRGB` twin's retyped as a 2D array -/// is refused, typed (`NotImplemented(TextureView)`, naming the view's format): Metal reads such -/// a view otherwise than the texture, unmeasured here. A view of its own type is made. +/// A two-plane YCbCr texture viewed in its own format retyped as a 2D array passes the plan (its +/// view reads the luma codes, `Texture::luma_view`); one in its `_sRGB` twin's is refused, typed +/// (`NotImplemented(TextureView)`, naming the view's format), unmeasured. A view of its own type +/// is made. #[test] -fn a_ycbcr_texture_retyped_is_refused_typed() { +fn a_ycbcr_texture_retyped_in_its_twin_is_refused_typed() { let (_, device) = lavapipe(); for (pf, view) in [ (PixelFormat::YCBCR84202P, PixelFormat::YCBCR84202P), (PixelFormat::YCBCR84202P, PixelFormat::YCBCR84202PSRGB), (PixelFormat::RGB84202P, PixelFormat::RGB84202P), (PixelFormat::YCBCR104442P, PixelFormat::YCBCR104442P), + (PixelFormat::YCBCR104442P, PixelFormat::YCBCR104442PSRGB), (PixelFormat::RGB104222P, PixelFormat::RGB104222P), ] { let mut source = texture(PixelFormat::RGBA8Unorm, TextureUsage::SHADER_READ); @@ -802,7 +804,8 @@ fn a_ycbcr_texture_retyped_is_refused_typed() { ..ViewRequest::of_format(&source, view) }; match check_view(&source, &retyped, device.profile()) { - Err(ViewRefusal::Unsupported(u)) => { + Ok(_) if pf == view => {} + Err(ViewRefusal::Unsupported(u)) if pf != view => { assert_eq!(u.feature, Feature::TextureView, "{pf:?} as {view:?}"); assert_eq!(u.needs, Needs::NotImplemented, "{pf:?} as {view:?}"); } diff --git a/crates/metal2vulkan-runtime/src/texture.rs b/crates/metal2vulkan-runtime/src/texture.rs index d4a752ae6..acb2c0fc9 100644 --- a/crates/metal2vulkan-runtime/src/texture.rs +++ b/crates/metal2vulkan-runtime/src/texture.rs @@ -5172,7 +5172,13 @@ impl Texture { } }; let mut record = record; - let storage = if !apart { + // A two-plane YCbCr texture's view as another type reads its luma codes alone + // (`texture/ycbcr_image.rs`). + let luma = self.luma_view(call, &record).transpose()?; + let storage = if let Some((storage, read_as)) = luma { + record.read_as = Some(read_as); + storage + } else if !apart { self.0.storage.clone() } else if let Some((image, read_as)) = self.read_through(&record) { self.device().shared().counts.view_through_swizzle_made(); diff --git a/crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs b/crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs index 701ef32d0..7584e6ef6 100644 --- a/crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs +++ b/crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs @@ -26,8 +26,14 @@ use ash::vk; use metal2vulkan::bind::{YCbCrCodes, YCbCrOutput, YCbCrPlanes}; use metal2vulkan::device::FormatUsage; use metal2vulkan::error::{Feature, Unsupported}; -use metal2vulkan::metal::format::{vk_format, ycbcr_format, ycbcr_renders, ChromaSubsampling}; -use metal2vulkan::metal::{PixelFormat, SamplerAddressMode, TextureType, TextureUsage}; +use metal2vulkan::metal::format::{ + vk_format, ycbcr_format, ycbcr_renders, ChromaSubsampling, YCbCrReads, +}; +use metal2vulkan::metal::TextureSwizzle as S; +use metal2vulkan::metal::{ + PixelFormat, SamplerAddressMode, TextureSwizzle, TextureSwizzleChannels, TextureType, + TextureUsage, +}; use metal2vulkan::vk::{ ComponentMapping, Format, FormatFeatureFlags2, ImageAspectFlags, ImageCreateFlags, ImageUsageFlags, ImageViewType, @@ -260,6 +266,111 @@ impl Texture { } } +impl Texture { + /// The storage of a view presenting `record` of this two-plane YCbCr texture in its own + /// format as another type (a 2D array, which `view_plan::check_view` admits), and the format + /// and swizzle its bindings read that storage through (`ViewRecord::read_as`). `None` for a + /// texture whose texels are no conversion of planes, and a view in another format or of the + /// texture's own type. + /// + /// Metal's view reads the luma plane's codes alone (our probe `ycv`, the M3 Max under macOS + /// 27.0.1, `read()` and a linear `sample()` of every texel, bit for bit): a texture read + /// converted (and a packed one) reads `(Y, 0, 0, 1)`, one read as codes `(0, Y, 0, 1)`, `Y` the + /// code over `2^b - 1`, and its linear sample is the luma channel of the code-reading + /// format's sample over the same planes; a swizzle applies to that read. So the view is an + /// image of the codes over the same planes (the code-reading format of the texture's bits and + /// subsampling, `RGB8_420_2P` to `RGB10_444_2P`; a packed texture's codes held unpacked) read + /// through a swizzle that keeps its luma. An `_sRGB` twin's view reads no defined value on + /// Metal (its texels change from run to run) and reads as its converted format's here. + /// Refused (`NotImplemented(TextureView)`) for a texture over plane 1 of its surface, which + /// is not measured. + pub(super) fn luma_view( + &self, + call: &'static str, + record: &ViewRecord, + ) -> Option> { + let Storage::Shadow { texels, copies, .. } = &self.0.storage else { + return None; + }; + let ShadowSource::Converted { conversion, .. } = &copies.source else { + return None; + }; + let own = &self.0.record; + if record.pixel_format != own.pixel_format || record.texture_type == own.texture_type { + return None; + } + let gap = || Error::Unsupported(Unsupported::not_implemented(Feature::TextureView)); + if conversion.over_plane_one() { + return Some(Err(gap())); + } + let (planes, span) = conversion.source(); + let read = planes.codes; + // The code-reading format of the texture's bits and subsampling, unpacked: its image + // holds the codes as the view reads them. + let code_format = PixelFormat::ALL.iter().copied().find(|&pf| { + ycbcr_format(pf).is_some_and(|f| { + f.reads == YCbCrReads::Codes + && !f.packed + && f.bits == read.bits + && f.subsampling == read.subsampling + }) + }); + let Some(code_format) = code_format else { + return Some(Err(gap())); + }; + let mut codes = read; + codes.output = YCbCrOutput::Codes; + let planes = YCbCrPlanes::new( + planes.size, + planes.luma, + planes.chroma, + (planes.range, planes.matrix), + codes, + ); + let [w, h] = planes.size.map(u64::from); + let mut descriptor = TextureDescriptor::texture_2d(code_format, w, h, false); + descriptor.usage = record.usage; + descriptor.resource_options = texels.options(); + descriptor.alpha_reads_one = true; + descriptor.address_mode_map = ycbcr_modes(codes); + // The luma, green of the codes, where the texture reads it: red read converted, green + // read as codes; then the view's swizzle over that read. + let luma = match read.output { + YCbCrOutput::Codes => [S::Zero, S::Green, S::Zero, S::One], + _ => [S::Green, S::Zero, S::Zero, S::One], + }; + let of = |channel: TextureSwizzle| match channel { + S::Red => luma[0], + S::Green => luma[1], + S::Blue => luma[2], + S::Alpha => luma[3], + other => other, + }; + let swizzle = TextureSwizzleChannels { + red: of(record.swizzle.red), + green: of(record.swizzle.green), + blue: of(record.swizzle.blue), + alpha: of(record.swizzle.alpha), + }; + let device = self.device(); + Some( + descriptor + .check_over_surface(device.properties().texture_rules()) + .map_err(|_| internal("a luma view's descriptor past its texture's")) + .and_then(|layout| { + device.converted_storage( + call, + Arc::clone(texels), + &descriptor, + &layout, + (&planes, span), + ) + }) + .map(|storage| (storage, (code_format, swizzle))), + ) + } +} + impl Texture { /// The write shadow of a 4:4:4 two-plane YCbCr texture whose writes Metal stores into its /// planes (`metal::format::ycbcr_writes_stored`), for Metal's `call`: an `RGBA32Uint` image of diff --git a/crates/metal2vulkan-runtime/src/upload.rs b/crates/metal2vulkan-runtime/src/upload.rs index 357a2a320..cba88bcee 100644 --- a/crates/metal2vulkan-runtime/src/upload.rs +++ b/crates/metal2vulkan-runtime/src/upload.rs @@ -39,10 +39,12 @@ //! are zero (a new buffer reads zero). use super::buffer::Buffer; +use super::device::lock; use super::error::{Error, MemoryKind}; use super::values::{CpuCacheMode, HazardTrackingMode, ResourceOptions, StorageMode}; use super::Device; use ash::vk; +use std::sync::{Arc, Mutex}; /// The size of a command buffer's first ordinary chunk. const FIRST_CHUNK_BYTES: u64 = 4 * 1024; @@ -58,6 +60,10 @@ pub(super) struct Uploads { /// The ordinary chunks opened: the next is [`FIRST_CHUNK_BYTES`] times two to this power, /// at most [`CHUNK_BYTES`]. opened: u32, + /// The arena of a predicated loop's check, lent while it records a run again + /// (`command_buffer/rerun.rs`): every region comes from it meanwhile, and goes once that run + /// completed. + lent: Option>>, } struct Chunk { @@ -80,9 +86,16 @@ impl Uploads { Uploads { chunks: Vec::new(), opened: 0, + lent: None, } } + /// Take every region from `lent`, a predicated loop's check's arena, while it is lent; `None`: + /// from this one again. + pub(super) fn lend(&mut self, lent: Option>>) { + self.lent = lent; + } + /// Every chunk, taken out: no command reads the arena any more, and the chunks go as the /// arena returned drops. pub(super) fn take(&mut self) -> Uploads { @@ -91,9 +104,16 @@ impl Uploads { Uploads { chunks: std::mem::take(&mut self.chunks), opened, + lent: None, } } + /// The bytes its regions took of its chunks (a device test's measure). + #[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))] + pub(super) fn bytes(&self) -> u64 { + self.chunks.iter().map(|chunk| chunk.used).sum() + } + /// A region of `len` bytes (at least `bytes.len()`) holding `bytes` and then zeros. pub(super) fn upload( &mut self, @@ -114,6 +134,9 @@ impl Uploads { len: u64, address_alignment: u64, ) -> Result { + if let Some(lent) = &self.lent { + return lock(lent).upload_aligned(device, bytes, len, address_alignment); + } let len = len.max(bytes.len() as u64); let alignment = device.shared().upload_alignment; // The first offset from `from`, a multiple of the upload alignment, whose device address diff --git a/crates/metal2vulkan-runtime/src/view_plan.rs b/crates/metal2vulkan-runtime/src/view_plan.rs index 5eb2eb188..6002351ea 100644 --- a/crates/metal2vulkan-runtime/src/view_plan.rs +++ b/crates/metal2vulkan-runtime/src/view_plan.rs @@ -36,8 +36,9 @@ //! types, the multisample types, and 3D alone. A view of a type that is not an array has one //! slice, a cube six, a cube array a multiple of six. Metal makes a cube view of an image that //! is not square, which Vulkan cannot (`NotRepresentable(TextureView)`). A two-plane YCbCr -//! texture's view of another type (a 2D array of its slice), which Metal reads otherwise than -//! the texture, is refused `NotImplemented(TextureView)`. +//! texture's view of another type (a 2D array of its slice) in its own format reads its luma +//! codes alone, as Metal's does (`Texture::luma_view`); one in its `_sRGB` twin's format is +//! refused `NotImplemented(TextureView)`, unmeasured. //! - **Ranges.** Levels and slices count from the viewed texture's own (a view of a view is //! relative to that view), are not empty, and stay in it. //! - **Swizzles.** A view made without a swizzle has the viewed texture's swizzle; one made with a @@ -474,11 +475,13 @@ pub(super) fn check_view( return Err(ViewProblem::TypeIncompatible.into()); } // Metal views a two-plane YCbCr texture in its own format (or its `_sRGB` twin's) retyped, - // as a 2D array of its one slice, and reads that view otherwise than the texture (the - // consumer's report, an M3 Max: the codes unconverted, luma in red for the 500- and - // 540-style formats, other values for the twins), unmeasured here: the runtime's gap. A view - // of its own type reads as the texture. - if ycbcr(source.pixel_format) && ty != source.texture_type { + // as a 2D array of its one slice, and reads that view otherwise than the texture: in its own + // format the luma codes alone (`Texture::luma_view`); in the twin's, unmeasured, the + // runtime's gap. A view of its own type reads as the texture. + if ycbcr(source.pixel_format) + && ty != source.texture_type + && request.pixel_format != source.pixel_format + { return Err(ViewRefusal::Unsupported( Unsupported::not_implemented(Feature::TextureView).naming_format(request.pixel_format), )); diff --git a/crates/metal2vulkan-runtime/src/work_counts.rs b/crates/metal2vulkan-runtime/src/work_counts.rs index 67a2967b5..b263d6b6c 100644 --- a/crates/metal2vulkan-runtime/src/work_counts.rs +++ b/crates/metal2vulkan-runtime/src/work_counts.rs @@ -2114,7 +2114,7 @@ impl Counters { .fetch_add(bytes as u64, Ordering::Relaxed); } - /// A rebind encoded an ended encoder again (`command_buffer/reencode.rs`). + /// A rebind or a map's reset encoded an ended encoder again (`command_buffer/reencode.rs`). pub(crate) fn encoder_reencoded(&self) { self.encoders_reencoded.fetch_add(1, Ordering::Relaxed); } @@ -3789,7 +3789,8 @@ pub struct WorkCounts { pub replay_logs_kept: u64, /// The bytes of the logs counted in `replay_logs_kept`. pub replay_log_bytes: u64, - /// Ended encoders a rebind encoded again before their command buffer's first submission + /// Ended encoders a rebind, or a reset of a rasterization-rate map a render pass took, + /// encoded again before their command buffer's first submission /// (`command_buffer/reencode.rs`). pub encoders_reencoded: u64, /// Work a command buffer's commit recorded on the GPU alone (a GPU-written execution's) that diff --git a/crates/metal2vulkan-runtime/src/ycbcr.rs b/crates/metal2vulkan-runtime/src/ycbcr.rs index f0148d173..df2afaad2 100644 --- a/crates/metal2vulkan-runtime/src/ycbcr.rs +++ b/crates/metal2vulkan-runtime/src/ycbcr.rs @@ -75,7 +75,12 @@ //! - **Views.** A converted texture's view as its `_sRGB` twin (Metal makes it with //! `ShaderRead` usage alone) is a texture of the twin over the same planes, with a conversion //! of its own: Metal's view reads what a texture of the twin over the surface reads, bit for -//! bit (`texture/ycbcr_image.rs`). +//! bit (`texture/ycbcr_image.rs`). A view in the texture's own format as a 2D array reads the +//! luma codes alone, `(Y, 0, 0, 1)`, or `(0, Y, 0, 1)` of a format read as codes, its linear +//! sample the luma of the code-reading format's (the M3 Max under macOS 27.0.1, bit for bit): +//! an image of the codes over the same planes read through a swizzle +//! (`Texture::luma_view`); an `_sRGB` twin's reads no defined value on Metal and reads as its +//! converted format's here. //! - **Refused** (`Unsupported`, `NotImplemented`, `Feature::Format`, naming what): a surface of //! an OSType the format is not measured over (Metal makes 505 and 543 over plane 0 of many //! more), or whose chroma plane is smaller than the format's (Metal reads past it), plane 1 of a @@ -87,10 +92,11 @@ //! buffer (above); a copy between two such textures (Metal copies both planes), a view in another //! format than the twin (a twin's view as its converted format among them, unmeasured), and a //! pass rendering into one but as **Passes** below say (Metal converts back into the planes). A -//! function's writes to a 4:2:0 or 4:2:2 format are dropped, as Metal drops them -//! (`metal::format::writes_dropped`); a 4:4:4 `_sRGB` twin's or packed format's are refused (the -//! twins' encoding is not found, and the M3 drops the packed formats' writes where the M4 stores -//! them), as are a texture's over plane 1 (not measured) and a slot's that reads the texture too. +//! function's writes to a 4:2:0, 4:2:2 or packed format are dropped, as Metal drops them (the +//! packed 4:4:4 ones on the M3 Max under macOS 27.0.1, where an M4 stores them; +//! `metal::format::writes_dropped`); a 4:4:4 `_sRGB` twin's are refused (the twins' encoding is +//! not found), as are a texture's over plane 1 (not measured) and a slot's that reads the +//! texture too. //! - **Writes** (on an Apple M4 under macOS 27.0.1, on an Apple M3 Max under macOS 26.7, byte for //! byte alike). Metal stores a function's writes to `YCBCR8_444_2P`, `YCBCR10_444_2P`, //! `RGB8_444_2P` and `RGB10_444_2P` (503, 507, 542, 545) into both planes: each written texel's @@ -523,7 +529,8 @@ impl YCbCrConversion { // The chroma bytes the planes read past their span, zeros (a texture over plane 1, // whose chroma codes are 0), filled at every conversion. let [cw, ch] = planes.chroma_size().map(u64::from); - let chroma_row = 2 * u64::from(planes.codes.bytes) * cw; + // A row of `2 * cw` codes: as many units, or a third of them packed. + let chroma_row = planes.codes.units(2 * cw) * u64::from(planes.codes.bytes); let [chroma_at, chroma_pitch] = planes.chroma.map(u64::from); let chroma_end = chroma_at + chroma_pitch * (ch.max(1) - 1) + chroma_row; let zeros = chroma_end.saturating_sub(bytes).next_multiple_of(4); diff --git a/crates/metal2vulkan-validation/runtime-sources.sha256 b/crates/metal2vulkan-validation/runtime-sources.sha256 index f9035c10d..cc12898b6 100644 --- a/crates/metal2vulkan-validation/runtime-sources.sha256 +++ b/crates/metal2vulkan-validation/runtime-sources.sha256 @@ -1 +1 @@ -31c9b9c54aeba7d2aa24700a420594fa3f03775c2b57dc5517a62bab80952ca9 +7f76785229ca157aa0dae2d247f54f87426020c5d3d002b32aafe6358077871d diff --git a/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs b/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs index 4ce2ffb87..6547f25bb 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs @@ -56,7 +56,8 @@ //! draw over an attachment loaded with `DontCare` in `clear_reach` ([`DONT_CARE_LOADS`]), passes //! that draw and load a rotated texture of rotation 4 in `rotated_textures` ([`ROTATED_LOADS`]), //! draws over a rate map of no layers made after a map of layers was released in -//! `rate_mapped_passes` ([`ZERO_LAYER_AFTER_RELEASE`]), +//! `rate_mapped_passes` ([`ZERO_LAYER_AFTER_RELEASE`]), and passes over a map reset after they took +//! it that the runtime cannot encode again there ([`RESET_UNENCODED`]), //! IOSurface planes under 16 bytes a row in `buffer_texture_blits` ([`NARROW_ROWS`]), one //! texture's depth stored and resolved beside its stencil resolved alone in `resolves` ([`MIXED_RESOLVES`]), mesh //! draws emulated on a device without `VK_EXT_mesh_shader` in `mesh_draws` ([`EMULATED_MESH`]), @@ -197,7 +198,7 @@ use super::patches::EMULATED_TESSELLATION; use super::predication::WORD_PAST_BUFFER; use super::provoking::PROVOKING; use super::pvrtc_textures::UNREADABLE; -use super::rate_mapped_passes::ZERO_LAYER_AFTER_RELEASE; +use super::rate_mapped_passes::{RESET_UNENCODED, ZERO_LAYER_AFTER_RELEASE}; use super::rebind_reach::REBOUND_USES; use super::resolves::{color_pass, lane, quiet, MIXED_RESOLVES, ONE}; use super::resource_ids::{ @@ -546,6 +547,7 @@ fn every_kind_has_a_site_a_lane_test_takes() { &REBOUND_USES, &DETACHED_REACHES, &ZERO_LAYER_AFTER_RELEASE, + &RESET_UNENCODED, &HEAP_LAYOUTS, &SHADER_DEPTH, &TIE_MIPMAPS, diff --git a/crates/metal2vulkan-validation/src/runtime_lane/rate_mapped_passes.rs b/crates/metal2vulkan-validation/src/runtime_lane/rate_mapped_passes.rs index cc75327fa..fd1d9111b 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/rate_mapped_passes.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/rate_mapped_passes.rs @@ -33,13 +33,15 @@ use super::{buffer_with, validated_device, Messages, ScratchCache, WAIT}; use crate::candidate::runtime_case::{render_pipeline_descriptor, render_pipeline_state}; use crate::gpu::TEST_DEVICE; use crate::store::CorpusStore; +use metal2vulkan::metal::Mutability; use metal2vulkan::metal::{PixelFormat, PrimitiveType, TextureType, TextureUsage}; use metal2vulkan_runtime::{ - Buffer, ClearColor, CommandBufferStatus, Degradation, Device, Error, Invalid, LoadAction, - Problem, RasterizationRateMap, Region, RegionRefusal, RenderCommandEncoder, + Buffer, ClearColor, CommandBufferStatus, Degradation, Device, Error, EventRef, Invalid, + LoadAction, Problem, RasterizationRateMap, Region, RegionRefusal, RenderCommandEncoder, RenderPassDescriptor, RenderPassProblem, RenderPipelineState, ResourceOptions, RuntimeGap, ScissorRect, StoreAction, Texture, TextureDescriptor, Viewport, }; +use std::collections::BTreeSet; use std::path::Path; /// The public case whose pipeline the passes draw. @@ -508,6 +510,263 @@ fn a_pass_over_a_map_of_no_layers_draws_nothing() { }); } +/// When a test resets the map from the identity to half quality (our probe `rm`'s cases). +#[derive(Clone, Copy, Debug, PartialEq)] +enum ResetAt { + /// After the encoder opened. + Opened, + /// After its draw. + Drawn, + /// After `end_encoding`. + Ended, + /// After `commit`, while the command buffer waits for an event the CPU signals after the + /// reset. + Held, + /// After the command buffer completed. + Completed, +} + +/// A map of the screen at `quality` (`Mutable` where `mutable`, reset to that quality). +fn reset_map(fixture: &Fixture, quality: f32, mutable: bool) -> RasterizationRateMap { + let mut made = descriptor(SCREEN, SCREEN, &[(quality, quality)]); + if mutable { + made.mutability = Mutability::Mutable; + } + let map = fixture.device.new_rasterization_rate_map(&made).unwrap(); + if mutable { + map.reset_using_descriptor(&descriptor(SCREEN, SCREEN, &[(quality, quality)])) + .unwrap(); + } + map +} + +/// A pass over `map` into `target` with one draw, `map` reset to `to` at `at`; the command +/// buffer completed. Before the reset where `before`, run on the command buffer before the pass. +fn reset_in_pass( + fixture: &Fixture, + map: &RasterizationRateMap, + target: &Texture, + to: &metal2vulkan::bind::RateMapDescriptor, + at: ResetAt, +) { + let device = &fixture.device; + let reset = || map.reset_using_descriptor(to).unwrap(); + let queue = device.new_command_queue().unwrap(); + let command_buffer = queue.command_buffer().unwrap(); + let event = device.new_shared_event().unwrap(); + if at == ResetAt::Held { + command_buffer + .encode_wait_for_event(EventRef::from(&event), 1) + .unwrap(); + } + let mut encoder = command_buffer + .render_command_encoder(&pass(map, target)) + .unwrap(); + if at == ResetAt::Opened { + reset(); + } + encoder.set_render_pipeline_state(&fixture.state).unwrap(); + encoder + .set_fragment_buffer(Some(&fixture.screen), 0, 0) + .unwrap(); + encoder + .draw_primitives(PrimitiveType::Triangle, 0, 3, 1, 0) + .unwrap(); + if at == ResetAt::Drawn { + reset(); + } + encoder.end_encoding().unwrap(); + if at == ResetAt::Ended { + reset(); + } + command_buffer.commit().unwrap(); + if at == ResetAt::Held { + reset(); + event.set_signaled_value(1); + } + command_buffer.wait_until_completed_for(WAIT).unwrap(); + assert_eq!(command_buffer.status(), CommandBufferStatus::Completed); + if at == ResetAt::Completed { + reset(); + } +} + +/// Our probe `rm` (the M3 Max under macOS 27.0.1, each case in a process of its own): Metal's +/// pass reads the map as the GPU runs it, so a reset from the identity to half quality after the +/// encoder opened, after its draw, after `end_encoding`, and after `commit` while the command +/// buffer waits for an event the CPU signals after the reset each shades the half-quality map's +/// 33 by 33 physical pixels; a reset after the command buffer completed leaves the identity's 64 +/// by 64. The runtime encodes the pass again for the reset, once, from its log: at the commit for +/// a reset before it, in the reset's call after it (`WorkCounts::encoders_reencoded`). A mutable +/// map and an immutable one alike (Metal resets either), and without a notice. +#[test] +fn a_reset_shows_in_a_pass_not_yet_submitted() { + let half = (33 * 33, [0, 0, 32, 32], [[0.5, 0.5], [32.5, 32.5]]); + let identity = (64 * 64, [0, 0, 63, 63], [[0.5, 0.5], [63.5, 63.5]]); + let to = descriptor(SCREEN, SCREEN, &[(0.5, 0.5)]); + for at in [ + ResetAt::Opened, + ResetAt::Drawn, + ResetAt::Ended, + ResetAt::Held, + ResetAt::Completed, + ] { + for mutable in [true, false] { + fresh(|fixture, messages| { + let map = reset_map(fixture, 1.0, mutable); + let target = fixture.target(64); + let before = fixture.device.work_counts().encoders_reencoded; + reset_in_pass(fixture, &map, &target, &to, at); + let again = fixture.device.work_counts().encoders_reencoded - before; + let case = format!("{at:?}, mutable {mutable}"); + match at { + ResetAt::Completed => { + assert_eq!(shaded(&target), identity, "{case}"); + assert_eq!(again, 0, "{case}"); + } + _ => { + assert_eq!(shaded(&target), half, "{case}"); + assert_eq!(again, 1, "{case}"); + } + } + let kinds = counts(&messages.take_notices()); + assert!( + !kinds.contains_key(&Degradation::RateMapResetUnencoded), + "{case}: {kinds:?}" + ); + }); + } + } +} + +/// Our probe `rm`'s `held_two`: two passes of one command buffer waiting for an event, the first +/// ended before a reset to half quality and the second opened after it, then a reset to a quarter +/// before the CPU signals the event: both shade the quarter's 32 by 32 physical pixels, as Metal's +/// GPU reads the map as it runs them. +#[test] +fn a_reset_shows_in_every_pass_not_yet_submitted() { + fresh(|fixture, _| { + let device = &fixture.device; + let map = reset_map(fixture, 1.0, true); + let queue = device.new_command_queue().unwrap(); + let command_buffer = queue.command_buffer().unwrap(); + let event = device.new_shared_event().unwrap(); + command_buffer + .encode_wait_for_event(EventRef::from(&event), 1) + .unwrap(); + let targets = [fixture.target(64), fixture.target(64)]; + for (index, target) in targets.iter().enumerate() { + if index == 1 { + map.reset_using_descriptor(&descriptor(SCREEN, SCREEN, &[(0.5, 0.5)])) + .unwrap(); + } + let mut encoder = command_buffer + .render_command_encoder(&pass(&map, target)) + .unwrap(); + encoder.set_render_pipeline_state(&fixture.state).unwrap(); + encoder + .set_fragment_buffer(Some(&fixture.screen), 0, 0) + .unwrap(); + encoder + .draw_primitives(PrimitiveType::Triangle, 0, 3, 1, 0) + .unwrap(); + encoder.end_encoding().unwrap(); + } + command_buffer.commit().unwrap(); + map.reset_using_descriptor(&descriptor(SCREEN, SCREEN, &[(0.25, 0.25)])) + .unwrap(); + event.set_signaled_value(1); + command_buffer.wait_until_completed_for(WAIT).unwrap(); + assert_eq!(command_buffer.status(), CommandBufferStatus::Completed); + let quarter = (32 * 32, [0, 0, 31, 31], [[0.5, 0.5], [31.5, 31.5]]); + for (index, target) in targets.iter().enumerate() { + assert_eq!(shaded(target), quarter, "pass {index}"); + } + }); +} + +/// Our probe `rm`'s `unset_pass`, `none_pass` and `none_mut_pass` (the M3 Max under macOS +/// 27.0.1): a pass over a mutable map not yet reset, and over a map of no layers made while no map +/// of layers was released, mutable or not, runs its clear and store and each draw's vertex +/// function (Metal's counted 3 runs for a triangle), and shades nothing. The runtime records the +/// draw through an empty scissor: its replay calls `vkCmdDraw` once (`commands_replayed`, on a +/// device that records through its recorder). +#[test] +fn a_pass_over_a_map_of_no_compiled_layers_runs_its_vertex_function_alone() { + let unset = |screen: u32, layers: &[(f32, f32)]| { + let mut made = descriptor(screen, screen, layers); + made.mutability = Mutability::Mutable; + made + }; + for (name, made) in [ + ("unset", unset(SCREEN, &[(0.5, 0.5)])), + ("none", descriptor(SCREEN, SCREEN, &[])), + ("none_mutable", unset(SCREEN, &[])), + ] { + fresh(|fixture, messages| { + let device = &fixture.device; + let map = device.new_rasterization_rate_map(&made).unwrap(); + let target = filled(fixture, 64); + let before = device.work_counts(); + fixture.draw(&map, &target, |_| {}).unwrap(); + let after = device.work_counts(); + assert!(cleared(&target), "{name}"); + if after.command_buffers_deferred > before.command_buffers_deferred { + let draws = after.commands_replayed.cmd_draw - before.commands_replayed.cmd_draw; + assert_eq!(draws, 1, "{name}: the vertex function's draw"); + } + assert!(!announced_after_release(messages), "{name}"); + }); + } +} + +/// The kind [`a_pass_the_runtime_cannot_encode_again_draws_by_the_map_it_took`] takes. +pub(super) const RESET_UNENCODED: [Degradation; 1] = [Degradation::RateMapResetUnencoded]; + +/// A pass whose command buffer used command predication keeps no log (`replay.rs`), so a reset +/// of its map before the commit cannot encode it again: it draws by the map as it took it, the +/// identity's 64 by 64 pixels, where Metal's GPU draws by the map as reset, and the commit +/// announces [`RESET_UNENCODED`], once for two such command buffers. +#[test] +fn a_pass_the_runtime_cannot_encode_again_draws_by_the_map_it_took() { + fresh(|fixture, messages| { + let device = &fixture.device; + let word = buffer_with(device, &0u32.to_le_bytes()).unwrap(); + let identity = (64 * 64, [0, 0, 63, 63], [[0.5, 0.5], [63.5, 63.5]]); + for _ in 0..2 { + let map = reset_map(fixture, 1.0, true); + let target = fixture.target(64); + let queue = device.new_command_queue().unwrap(); + let command_buffer = queue.command_buffer().unwrap(); + let mut compute = command_buffer.compute_command_encoder().unwrap(); + compute.encode_start_if(Some(&word), 0, 0, 0).unwrap(); + compute.encode_end_if().unwrap(); + compute.end_encoding().unwrap(); + let mut encoder = command_buffer + .render_command_encoder(&pass(&map, &target)) + .unwrap(); + encoder.set_render_pipeline_state(&fixture.state).unwrap(); + encoder + .set_fragment_buffer(Some(&fixture.screen), 0, 0) + .unwrap(); + encoder + .draw_primitives(PrimitiveType::Triangle, 0, 3, 1, 0) + .unwrap(); + encoder.end_encoding().unwrap(); + map.reset_using_descriptor(&descriptor(SCREEN, SCREEN, &[(0.5, 0.5)])) + .unwrap(); + command_buffer.commit().unwrap(); + command_buffer.wait_until_completed_for(WAIT).unwrap(); + assert_eq!(command_buffer.status(), CommandBufferStatus::Completed); + assert_eq!(shaded(&target), identity); + } + // Beside it, the fixture's making and buffer, and the reset's map drawn by regions. + let mut made: BTreeSet = fixture.made.clone(); + made.insert(Degradation::RasterizationRateMap); + assert_made_once(messages, &RESET_UNENCODED, &made); + }); +} + /// Probes 16, 16b and 16c's refusals, and the region path's (the module docs). #[test] fn rate_mapped_passes_are_refused_where_metal_or_the_runtime_refuses_them() { diff --git a/crates/metal2vulkan-validation/src/runtime_lane/rate_maps.rs b/crates/metal2vulkan-validation/src/runtime_lane/rate_maps.rs index cd27c5be1..b0dbdc814 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/rate_maps.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/rate_maps.rs @@ -18,6 +18,7 @@ use crate::gpu::TEST_DEVICE; use metal2vulkan::bind::{ RasterizationRateMap as CompiledMap, RateMapDescriptor, RateMapLayerDescriptor, UnpinnedCompile, }; +use metal2vulkan::metal::Mutability; use metal2vulkan_runtime::{ Coordinate2D, CpuCacheMode, Degradation, Device, Error, HazardTrackingMode, Invalid, Problem, RateMapProblem, ResourceOptions, Size, StorageMode, @@ -110,8 +111,8 @@ fn a_rate_map_answers_as_metal_does() { assert_eq!(map.physical_size_for_layer(u64::MAX), Size::new(0, 33, 1)); let at = Coordinate2D::new(10.0, 10.0); for layer in [0, 1, u64::MAX] { - let physical = map.map_screen_to_physical_coordinates(at, layer); - let screen = map.map_physical_to_screen_coordinates(at, layer); + let physical = map.map_screen_to_physical_coordinates(at, layer).unwrap(); + let screen = map.map_physical_to_screen_coordinates(at, layer).unwrap(); for value in [physical.x, physical.y] { assert!( (value - 5.079_365_3).abs() <= 1.0e-5, @@ -132,6 +133,21 @@ fn a_rate_map_answers_as_metal_does() { assert_eq!(empty.layer_count(), 0); assert_eq!(empty.physical_granularity(), Size::new(32, 32, 1)); assert_eq!(empty.physical_size_for_layer(0), Size::new(0, 16, 1)); + // Its coordinate maps end Metal's process: refused. + let no_layers = |call| { + Err(Error::Invalid(Invalid::new( + call, + Problem::RateMap(RateMapProblem::NoLayers), + ))) + }; + assert_eq!( + empty.map_screen_to_physical_coordinates(at, 0), + no_layers("map_screen_to_physical_coordinates") + ); + assert_eq!( + empty.map_physical_to_screen_coordinates(at, 0), + no_layers("map_physical_to_screen_coordinates") + ); let two = device .new_rasterization_rate_map(&descriptor(64, 64, &[(0.5, 0.5), (1.0, 0.25)])) .unwrap(); @@ -280,3 +296,102 @@ fn parameter_data_copies_where_the_cpu_reaches() { assert!(reported.is_empty(), "the second device: {reported:#?}"); }); } + +/// A mutable map answers as Metal's does on an M3 Max: before its first reset, its descriptor's +/// screen and layer count, a physical size of 0 by 0 at every layer, Metal's granularity and +/// parameter size, a screen-to-physical map to (0, 0), parameter data of zeros, and a refused +/// physical-to-screen map (it ends Metal's process); plain Metal makes it of a descriptor its API +/// validation stops (three layers, a screen side of 0 or 40000). Its reset compiles the descriptor given, to Metal's bytes and answers, +/// keeping the map's label and mutability; a reset refuses three layers (Metal's process ends) and +/// a screen side of 0 (the compile layer's), changing nothing. A map reset to no layers keeps the +/// widths of its earlier layers, and its tables past the new entries. +#[test] +fn a_mutable_map_answers_as_metal_until_its_reset() { + on_device(|device, _| { + let mut made = descriptor(64, 64, &[(0.5, 0.5)]); + made.mutability = Mutability::Mutable; + made.label = Some("mut".to_owned()); + let map = device.new_rasterization_rate_map(&made).unwrap(); + assert_eq!(map.mutability(), Mutability::Mutable); + assert_eq!(map.label(), Some("mut")); + assert_eq!(map.screen_size(), Size::new(64, 64, 1)); + assert_eq!(map.layer_count(), 1); + for layer in [0, 1, u64::MAX] { + assert_eq!(map.physical_size_for_layer(layer), Size::new(0, 0, 1)); + } + assert_eq!(map.physical_granularity(), Size::new(32, 32, 1)); + let sized = map.parameter_buffer_size_and_align(); + assert_eq!((sized.size, sized.align), (24_624, 4)); + let at = Coordinate2D::new(10.0, 10.0); + assert_eq!( + map.map_screen_to_physical_coordinates(at, 0), + Ok(Coordinate2D::new(0.0, 0.0)) + ); + assert_eq!( + map.map_physical_to_screen_coordinates(at, 0), + Err(Error::Invalid(Invalid::new( + "map_physical_to_screen_coordinates", + Problem::RateMap(RateMapProblem::NotCompiled), + ))) + ); + let copied = |map: &metal2vulkan_runtime::RasterizationRateMap| { + let shared = ResourceOptions::new( + StorageMode::Shared, + CpuCacheMode::DefaultCache, + HazardTrackingMode::Tracked, + ); + let buffer = device.new_buffer(24_624, shared).unwrap(); + map.copy_parameter_data_to_buffer(&buffer, 0).unwrap(); + read_buffer(&buffer, 0, 24_624).unwrap() + }; + assert!(copied(&map).iter().all(|&b| b == 0), "a map not yet reset"); + // Plain Metal makes a mutable map of a descriptor its API validation stops. + for (width, layers) in [(64, 3), (0, 1), (40000, 1)] { + let mut stopped = descriptor(width, 64, &[(0.5, 0.5); 3][..layers]); + stopped.mutability = Mutability::Mutable; + let unset = device.new_rasterization_rate_map(&stopped).unwrap(); + assert_eq!(unset.screen_size(), Size::new(width.into(), 64, 1)); + assert_eq!(unset.layer_count(), layers as u64); + assert_eq!(unset.physical_size_for_layer(0), Size::new(0, 0, 1)); + assert!(copied(&unset).iter().all(|&b| b == 0)); + } + let mut half = descriptor(64, 64, &[(0.5, 0.5)]); + half.label = Some("reset".to_owned()); + map.reset_using_descriptor(&half).unwrap(); + assert_eq!(map.label(), Some("mut")); + assert_eq!(map.mutability(), Mutability::Mutable); + assert_eq!(map.physical_size_for_layer(0), Size::new(33, 33, 1)); + assert_eq!(copied(&map), CompiledMap::new(&half).unwrap().to_bytes()); + let physical = map.map_screen_to_physical_coordinates(at, 0).unwrap(); + for value in [physical.x, physical.y] { + assert!((value - 5.079_365_3).abs() <= 1.0e-5, "{physical:?}"); + } + let before = copied(&map); + assert_eq!( + map.reset_using_descriptor(&descriptor(64, 64, &[(0.5, 0.5); 3])), + Err(Error::Invalid(Invalid::new( + "reset_using_descriptor", + Problem::RateMap(RateMapProblem::LayerCount { count: 3 }), + ))) + ); + assert_eq!( + map.reset_using_descriptor(&descriptor(0, 64, &[(0.5, 0.5)])), + Err(Error::RateMap(UnpinnedCompile::ScreenExtent { extent: 0 })) + ); + assert_eq!(copied(&map), before, "a refused reset"); + // A map of another mutability is compiled at once, and a reset compiles over it. + let mut plain = descriptor(100, 60, &[(0.5, 0.5), (0.25, 0.25)]); + plain.mutability = Mutability::Default; + let map = device.new_rasterization_rate_map(&plain).unwrap(); + assert_eq!(map.mutability(), Mutability::Default); + let none = descriptor(64, 32, &[]); + map.reset_using_descriptor(&none).unwrap(); + assert_eq!(map.layer_count(), 0); + assert_eq!(map.physical_size_for_layer(0), Size::new(64, 16, 1)); + assert_eq!(map.physical_size_for_layer(1), Size::new(32, 16, 1)); + assert_eq!(map.physical_size_for_layer(2), Size::new(0, 16, 1)); + let earlier = CompiledMap::new(&plain).unwrap(); + let over = CompiledMap::new_over(&none, earlier.words()).unwrap(); + assert_eq!(copied(&map), over.to_bytes()); + }); +} diff --git a/crates/metal2vulkan-validation/src/runtime_lane/ycbcr_textures.rs b/crates/metal2vulkan-validation/src/runtime_lane/ycbcr_textures.rs index 324bceba3..fb13141d0 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/ycbcr_textures.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/ycbcr_textures.rs @@ -19,9 +19,9 @@ //! buffer, an earlier encoder of the same one, an earlier dispatch of the same encoder, and a //! blit; and the CPU's writes between command buffers. //! - A kernel's writes to it are dropped, as Metal drops them; `get_bytes` reads the luma rows. -//! A 4:4:4 format's writes are stored into both planes as Metal stores them, every other byte -//! kept; those of the 4:4:4 formats whose writes are not known (the `_sRGB` twins, the packed -//! format) and over plane 1 are refused, typed. +//! An unpacked 4:4:4 format's writes are stored into both planes as Metal stores them, every +//! other byte kept, and a packed one's dropped; those of the `_sRGB` twins, whose writes are not +//! known, and over plane 1 are refused, typed. //! - Plain creation and a buffer's texture of the format answer Metal's nil (`Error::Nil`, //! `NoTextureOfFormat`) and the heap query 0 bytes at 16; a surface without its facts, plane 1 //! and a matrix other than BT.601, BT.709 and BT.2020 are refused, typed. Every other two-plane @@ -79,7 +79,8 @@ const FULL: u32 = u32::from_be_bytes(*b"420f"); /// texture's size, samples point `gid` at the centre of texel `gid - size / 4`, a quarter of /// the points inside the texture and the rest outside it. `write_masked` writes buffer 0's /// `float4` element `gid.y * width + gid.x` to texel `gid` of texture 0 where buffer 1's `uint` -/// element there is not 0, and `write_masked_half` the same of `half4`s. +/// element there is not 0, and `write_masked_half` the same of `half4`s. `read_array` and +/// `sample_array_between` are `read_texels` and `sample_between` of slice 0 of a 2D array. pub(super) const KERNELS: &str = r#"; Owned synthetic kernels. source_filename = "ycbcr_textures.metal" @@ -328,8 +329,45 @@ done: ret void } +define void @read_array(ptr addrspace(1) %t, ptr addrspace(1) noalias %out, <2 x i32> %gid, <2 x i32> %size) { +entry: + %s = tail call ptr addrspace(2) @air.get_read_sampler() + %r = tail call { <4 x float>, i8 } @air.read_texture_2d_array.v4f32(ptr addrspace(1) %t, ptr addrspace(2) %s, <2 x i32> %gid, i32 0, <2 x i32> zeroinitializer, i32 0, i32 1) + %v = extractvalue { <4 x float>, i8 } %r, 0 + %x = extractelement <2 x i32> %gid, i64 0 + %y = extractelement <2 x i32> %gid, i64 1 + %w = extractelement <2 x i32> %size, i64 0 + %row = mul i32 %y, %w + %i = add i32 %row, %x + %j = zext i32 %i to i64 + %p = getelementptr inbounds <4 x float>, ptr addrspace(1) %out, i64 %j + store <4 x float> %v, ptr addrspace(1) %p, align 16 + ret void +} + +define void @sample_array_between(ptr addrspace(1) %t, ptr addrspace(1) noalias %out, ptr addrspace(2) %smp, <2 x i32> %gid, <2 x i32> %size) { +entry: + %g = tail call <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %gid) + %n = tail call <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %size) + %c = fadd <2 x float> %g, + %uv = fdiv <2 x float> %c, %n + %r = tail call { <4 x float>, i8 } @air.sample_texture_2d_array.v4f32(ptr addrspace(1) %t, ptr addrspace(2) %smp, <2 x float> %uv, i32 0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) + %v = extractvalue { <4 x float>, i8 } %r, 0 + %x = extractelement <2 x i32> %gid, i64 0 + %y = extractelement <2 x i32> %gid, i64 1 + %w = extractelement <2 x i32> %size, i64 0 + %row = mul i32 %y, %w + %i = add i32 %row, %x + %j = zext i32 %i to i64 + %p = getelementptr inbounds <4 x float>, ptr addrspace(1) %out, i64 %j + store <4 x float> %v, ptr addrspace(1) %p, align 16 + ret void +} + declare ptr addrspace(2) @air.get_read_sampler() declare <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32>) +declare { <4 x float>, i8 } @air.read_texture_2d_array.v4f32(ptr addrspace(1), ptr addrspace(2), <2 x i32>, i32, <2 x i32>, i32, i32) +declare { <4 x float>, i8 } @air.sample_texture_2d_array.v4f32(ptr addrspace(1), ptr addrspace(2), <2 x float>, i32, i1, <2 x i32>, i1, float, float, i32) declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1), ptr addrspace(2), <2 x i32>, <2 x i32>, i32, i32) declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1), ptr addrspace(2), <2 x float>, i1, <2 x i32>, i1, float, float, i32) declare { <4 x half>, i8 } @air.read_texture_2d.v4f16(ptr addrspace(1), ptr addrspace(2), <2 x i32>, <2 x i32>, i32, i32) @@ -339,7 +377,7 @@ declare void @air.write_texture_2d.v4f16(ptr addrspace(1), <2 x i32>, <4 x half> declare { <4 x float>, i8 } @air.gather_texture_2d.v4f32(ptr addrspace(1), ptr addrspace(2), <2 x float>, i1, <2 x i32>, i32, i32) declare { <4 x half>, i8 } @air.gather_texture_2d.v4f16(ptr addrspace(1), ptr addrspace(2), <2 x float>, i1, <2 x i32>, i32, i32) -!air.kernel = !{!0, !10, !20, !40, !50, !60, !70, !80, !81, !82, !83, !90, !96} +!air.kernel = !{!0, !10, !20, !40, !50, !60, !70, !80, !81, !82, !83, !90, !96, !100, !110} !air.version = !{!30} !air.language_version = !{!31} !0 = !{ptr @read_texels, !1, !2} @@ -382,6 +420,12 @@ declare { <4 x half>, i8 } @air.gather_texture_2d.v4f16(ptr addrspace(1), ptr ad !97 = !{!98, !99, !93, !94, !95} !98 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.write", !"air.arg_type_name", !"texture2d", !"air.arg_name", !"t"} !99 = !{i32 1, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.arg_type_size", i32 8, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"half4", !"air.arg_name", !"values"} +!100 = !{ptr @read_array, !1, !101} +!101 = !{!102, !4, !5, !6} +!102 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.read", !"air.arg_type_name", !"texture2d_array", !"air.arg_name", !"t"} +!110 = !{ptr @sample_array_between, !1, !111} +!111 = !{!112, !4, !13, !14, !15} +!112 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.sample", !"air.arg_type_name", !"texture2d_array", !"air.arg_name", !"t"} !30 = !{i32 2, i32 8, i32 0} !31 = !{!"Metal", i32 4, i32 0, i32 0} "#; @@ -400,6 +444,9 @@ struct Kernels { gathers: [[ComputePipelineState; 2]; 2], /// Writes of `float4` and of `half4` values to the texels a mask names. write_masked: [ComputePipelineState; 2], + /// `read_texels` and `sample_between` of slice 0 of a 2D array. + read_array: ComputePipelineState, + sample_array: ComputePipelineState, } impl Kernels { @@ -431,6 +478,8 @@ impl Kernels { [state("gather_blue"), state("gather_blue_half")], ], write_masked: [state("write_masked"), state("write_masked_half")], + read_array: state("read_array"), + sample_array: state("sample_array_between"), } } } @@ -2190,9 +2239,9 @@ fn a_four_four_four_texture_s_writes_store_metal_s_codes() { /// The 4:4:4 writes whose codes are not known stay refused, typed (`Feature::Format`), and leave /// the surface's bytes as they were: the `_sRGB` twins' (no arithmetic found matches Metal's -/// codes), the packed format's (the M3 drops them where the M4 stores them), and a texture's over -/// plane 1 of a 4:4:4 surface (not measured). A 4:2:2 texture over its own surface still drops -/// them, as Metal does. +/// codes) and a texture's over plane 1 of a 4:4:4 surface (not measured). A 4:2:2 texture over +/// its own surface drops them, as Metal does, and so does a packed 4:4:4 one, as the M3 Max +/// under macOS 27.0.1 does (`metal::format::writes_dropped`). #[test] fn four_four_four_writes_of_unknown_codes_are_refused_typed() { on_device(|device, _| { @@ -2202,7 +2251,8 @@ fn four_four_four_writes_of_unknown_codes_are_refused_typed() { for (seed, pf, ostype, plane, dropped) in [ (141, PixelFormat::YCBCR84442PSRGB, "444v", 0, false), (142, PixelFormat::YCBCR104442PSRGB, "xf44", 0, false), - (143, PixelFormat::YCBCR104442PPACKED, "p444", 0, false), + (143, PixelFormat::YCBCR104442PPACKED, "p444", 0, true), + (147, PixelFormat::YCBCR104442PPACKEDSRGB, "pf44", 0, true), (144, PixelFormat::YCBCR84442P, "444f", 1, false), (145, PixelFormat::RGB104442P, "x444", 1, false), (146, PixelFormat::YCBCR84222P, "422v", 0, true), @@ -4046,6 +4096,127 @@ fn packed_views_read_their_twins_texels() { }); } +/// A two-plane YCbCr texture's view in its own format as a 2D array reads its luma codes alone, +/// as Metal's does (our probe `ycv`, the M3 Max under macOS 27.0.1, bit for bit over every texel): +/// `(Y, 0, 0, 1)` of a texture read converted, packed or through the sRGB curve (whose view +/// reads no defined value on Metal: its texels change from run to run), `(0, Y, 0, 1)` of one +/// read as codes, `Y` the code over `2^b - 1`; a swizzle applies to that read; and a linear +/// sample is the luma channel of the code-reading format's sample over the same planes. The +/// texture itself still reads its own conversion; a texture over plane 1 refuses the view. +#[test] +fn retyped_views_read_their_luma_codes() { + use metal2vulkan::metal::TextureSwizzle as S; + on_device(|device, _| { + let kernels = Kernels::new(device); + let linear = sampler(device, SamplerMinMagFilter::Linear); + let array = |t: &Texture, swizzle: Option| { + let (pf, array) = (t.pixel_format(), TextureType::Type2DArray); + match swizzle { + None => t.new_texture_view_with_levels_slices(pf, array, 0..1, 0..1), + Some(s) => t.new_texture_view_with_swizzle(pf, array, 0..1, 0..1, s), + } + }; + let floats = |t: &[u8]| -> Vec<[f32; 4]> { + let channel = |t: &[u8; 16], i: usize| { + f32::from_le_bytes(t[4 * i..4 * i + 4].try_into().unwrap()) + }; + let chunks = t.as_chunks::<16>().0; + chunks + .iter() + .map(|t| std::array::from_fn(|i| channel(t, i))) + .collect() + }; + let swizzle = TextureSwizzleChannels { + red: S::Blue, + green: S::Red, + blue: S::One, + alpha: S::Green, + }; + for (seed, (pf, ostype)) in (380..).zip([ + (PixelFormat::YCBCR84202P, "420v"), + (PixelFormat::YCBCR84222P, "422f"), + (PixelFormat::YCBCR84442P, "444v"), + (PixelFormat::YCBCR104202P, "xf20"), + (PixelFormat::YCBCR104222P, "x422"), + (PixelFormat::YCBCR104442P, "x444"), + (PixelFormat::RGB84202P, "420v"), + (PixelFormat::RGB104442P, "xf44"), + (PixelFormat::YCBCR104202PPACKED, "pf20"), + (PixelFormat::YCBCR104442PPACKED, "p444"), + (PixelFormat::YCBCR84202PSRGB, "420f"), + ]) { + let format = ycbcr_format(pf).unwrap(); + let codes = YCbCrCodes::of(format).unwrap(); + let bytes = family_bytes(seed, codes); + let surface = buffer_with(device, &bytes).unwrap(); + let base = family_texture(&surface, pf, ostype, None).unwrap(); + let own = texels_of(device, &kernels.read, &base, None); + let view = array(&base, None).unwrap(); + assert_eq!(view.pixel_format(), pf); + assert_eq!(view.texture_type(), TextureType::Type2DArray); + let max = (1u32 << codes.bits) - 1; + let at_green = format.reads == YCbCrReads::Codes; + let want: Vec<[u16; 3]> = (0..H) + .flat_map(|y| (0..W).map(move |x| (y, x))) + .map(|(y, x)| { + let luma = code_of(&bytes, codes, y * ROWQ, x); + match at_green { + true => [0, luma, 0], + false => [luma, 0, 0], + } + }) + .collect(); + let read = texels_of(device, &kernels.read_array, &view, None); + assert_eq!(grid_of(&read, max), want, "{pf:?}'s view"); + // The swizzle (blue, red, one, green) over that read. + let swizzled = array(&base, Some(swizzle)).unwrap(); + let mapped: Vec<[f32; 4]> = (floats(&read).iter()) + .map(|&[r, g, b, _]| [b, r, 1.0, g]) + .collect(); + let swizzled = floats(&texels_of(device, &kernels.read_array, &swizzled, None)); + assert_eq!(swizzled, mapped, "{pf:?}'s swizzled view"); + // The texture reads its own conversion still. + assert_eq!(texels_of(device, &kernels.read, &base, None), own, "{pf:?}"); + // A linear sample: the code-reading format's over the same planes, its luma. + if format.packed { + continue; + } + let code_format = PixelFormat::ALL.iter().copied().find(|&c| { + ycbcr_format(c).is_some_and(|f| { + f.reads == YCbCrReads::Codes + && !f.packed + && (f.bits, f.subsampling) == (format.bits, format.subsampling) + }) + }); + let twin = family_texture(&surface, code_format.unwrap(), ostype, None).unwrap(); + let sampled = texels_of(device, &kernels.sample_array, &view, Some(&linear)); + let between = texels_of(device, &kernels.between, &twin, Some(&linear)); + let want: Vec<[f32; 4]> = (floats(&between).iter()) + .map(|&[_, y, _, _]| match at_green { + true => [0.0, y, 0.0, 1.0], + false => [y, 0.0, 0.0, 1.0], + }) + .collect(); + assert_eq!(floats(&sampled), want, "{pf:?}'s view sampled"); + } + // Over plane 1, not measured: refused. + let pf = PixelFormat::YCBCR84442P; + let codes = ycbcr_format(pf).and_then(YCbCrCodes::of).unwrap(); + let surface = buffer_with(device, &family_bytes(390, codes)).unwrap(); + let mut d = TextureDescriptor::texture_2d(pf, W, H, false); + d.usage = TextureUsage::SHADER_READ; + d.resource_options = ResourceOptions::shared(); + let code = u32::from_be_bytes(*b"444f"); + let facts = IoSurfaceYCbCr::new(code, 1, [W, H], CHROMAQ_AT, ROWQ); + let at = IoSurfacePlane::new(CHROMAQ_AT, ROWQ, true).with_ycbcr(facts); + let plane_one = surface.new_texture_with_iosurface_plane(&d, at).unwrap(); + assert!(matches!( + array(&plane_one, None), + Err(Error::Unsupported(_)) + )); + }); +} + /// A packed texture's CPU calls move nothing, as Metal's (48 `getBytes` and 48 /// `replaceRegion` calls): `get_bytes` leaves the bytes it is given and `replace_region` the /// planes, at a row's words, twice them, four bytes a texel and 256 bytes a row, the texture diff --git a/crates/metal2vulkan/src/bind/rate_map.rs b/crates/metal2vulkan/src/bind/rate_map.rs index 8699a895a..116b58d99 100644 --- a/crates/metal2vulkan/src/bind/rate_map.rs +++ b/crates/metal2vulkan/src/bind/rate_map.rs @@ -66,6 +66,7 @@ use std::fmt; use crate::air::canon::rate_map_data as format; +use crate::metal::Mutability; /// The physical granularity of a map: the width and height in physical pixels of every tile but /// each axis's last (Apple M3 and M4 report the same, and Metal's parameter data is per 32 @@ -99,7 +100,7 @@ const MAX_MEASURED_SAMPLES: [usize; MAX_COMPILED_LAYERS] = [9, 4]; /// A rasterization-rate map's description (`MTLRasterizationRateMapDescriptor`). #[non_exhaustive] -#[derive(Clone, Debug, Default, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub struct RateMapDescriptor { /// `screenSize`: the width and height in screen pixels of the region from the origin. pub screen_size: [u32; 2], @@ -107,15 +108,27 @@ pub struct RateMapDescriptor { pub layers: Vec, /// `label`: the name the map keeps. The compile ignores it. pub label: Option, + /// `mutability` (Apple's private `setMutability:`): `Immutable` until set, as Metal's + /// descriptor answers. A map made of a `Mutable` descriptor is compiled only at its reset + /// (the runtime's `RasterizationRateMap::reset_using_descriptor`). The compile ignores it. + pub mutability: Mutability, +} + +impl Default for RateMapDescriptor { + /// [`RateMapDescriptor::new`] of an empty screen. + fn default() -> RateMapDescriptor { + RateMapDescriptor::new([0, 0]) + } } impl RateMapDescriptor { - /// A descriptor of `screen_size` with no layers and no label. + /// A descriptor of `screen_size` with no layers and no label, `Immutable`. pub fn new(screen_size: [u32; 2]) -> RateMapDescriptor { RateMapDescriptor { screen_size, layers: Vec::new(), label: None, + mutability: Mutability::Immutable, } } } @@ -181,7 +194,10 @@ pub enum RateMapError { #[derive(Clone, Debug, PartialEq, Eq)] pub enum UnpinnedCompile { /// A screen extent above 16384: Apple's compile crashed on every width from 24576 and a - /// height of 32768, and returned a map of a corrupt physical size at a height of 16385. + /// height of 32768, and returned a map of a corrupt physical size at a height of 16385. Or + /// one of 0, which Metal's API validation stops at a map's creation, and which a reset + /// (where it does not look) compiles to no physical extent on that axis, not measured + /// further. ScreenExtent { extent: u32 }, /// More than two layers: Apple M3 supports two, and its compile crashes on more. LayerCount { count: usize }, @@ -216,6 +232,9 @@ pub enum UnpinnedCompile { impl fmt::Display for UnpinnedCompile { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { + UnpinnedCompile::ScreenExtent { extent: 0 } => { + f.write_str("a screen extent of 0, whose compile is not measured") + } UnpinnedCompile::ScreenExtent { extent } => write!( f, "screen extent {extent} is above {MAX_COMPILED_EXTENT}, where Apple's compile \ @@ -478,6 +497,10 @@ impl RasterizationRateMap { /// (`parameterBufferSizeAndAlign.align`). pub const PARAMETER_DATA_ALIGNMENT: u64 = 4; + /// The parameter data's size in bytes (`parameterBufferSizeAndAlign.size`): 24,624, Metal's + /// for every map ([`Self::parameter_data_size`]). + pub const PARAMETER_DATA_SIZE: u64 = format::BYTES as u64; + /// Compile `desc` (`newRasterizationRateMapWithDescriptor:`) by this module's rule, Apple /// M3's, or refuse it ([`RateMapError::Unpinned`]) outside the bounds the rule is measured in. /// A descriptor of no layers compiles to a map of none. @@ -559,6 +582,27 @@ impl RasterizationRateMap { )) } + /// [`Self::new`] of `desc`, its tables written over `earlier`, the parameter data's words a + /// map held, as Metal's private `resetUsingDescriptor:` writes them: every entry this map's + /// tables write ([`Self::words`] holds which: each table's lines, and zero words past them), + /// and every other word as `earlier` holds it. So a map reset to fewer layers, or to a smaller + /// screen, keeps the entries past its own (measured on an Apple M3 Max under macOS 27.0.1: + /// every word of maps of no layers reset from maps of one and two layers and from a taller + /// screen). Words past `earlier`'s are zero. Only the parameter data differs from + /// [`Self::new`]'s map: the CPU coordinate maps read no entry past a map's own. + pub fn new_over( + desc: &RateMapDescriptor, + earlier: &[u32], + ) -> Result { + let mut map = RasterizationRateMap::new(desc)?; + let mut words = vec![0u32; format::WORDS as usize]; + let kept = earlier.len().min(words.len()); + words[..kept].copy_from_slice(&earlier[..kept]); + map.encode_into(&mut words); + map.words = words; + Ok(map) + } + /// Whether every layer's every tile spans as many screen pixels as physical ones: the map /// is the identity inside the screen. pub fn is_identity(&self) -> bool { @@ -603,27 +647,34 @@ impl RasterizationRateMap { layers: Vec<[RateMapAxis; 2]>, vertical: &RateMapAxis, ) -> RasterizationRateMap { + let mut map = RasterizationRateMap { + screen_size, + layers, + vertical: vertical.clone(), + words: Vec::new(), + }; let mut words = vec![0u32; format::WORDS as usize]; - for (l, [horizontal, _]) in (0u32..).zip(&layers) { + map.encode_into(&mut words); + map.words = words; + map + } + + /// Write its tables' entries into `words` (the parameter data's), leaving every other word. + fn encode_into(&self, words: &mut [u32]) { + for (l, [horizontal, _]) in (0u32..).zip(&self.layers) { encode( - &mut words, + words, horizontal, format::table(l, 0, false), format::table(l, 0, true), ); } encode( - &mut words, - vertical, + words, + &self.vertical, format::table(0, 1, false), format::table(0, 1, true), ); - RasterizationRateMap { - screen_size, - layers, - vertical: vertical.clone(), - words, - } } /// `screenSize`. diff --git a/crates/metal2vulkan/src/bind/rate_map/tests.rs b/crates/metal2vulkan/src/bind/rate_map/tests.rs index 867e141ed..3eae0ca4b 100644 --- a/crates/metal2vulkan/src/bind/rate_map/tests.rs +++ b/crates/metal2vulkan/src/bind/rate_map/tests.rs @@ -824,3 +824,57 @@ fn unmeasured_descriptors_are_refused() { .to_string() .contains("3 layers")); } + +/// FNV-1a, 64 bits, of `bytes`: a short name for Metal's measured parameter data. +fn fnv(bytes: &[u8]) -> u64 { + bytes.iter().fold(0xcbf2_9ce4_8422_2325, |hash, &byte| { + (hash ^ u64::from(byte)).wrapping_mul(0x0100_0000_01b3) + }) +} + +/// A reset writes the new map's tables over the old (`new_over`), as Metal's private +/// `resetUsingDescriptor:` does (our probe `none`, the M3 Max under macOS 27.0.1: a mutable map of +/// 64 by 32 screen pixels reset to 100 by 60 at one and two layers, then to no layers; every byte of +/// each map's parameter data, here by its hash). Each map reset to no layers keeps the horizontal +/// tables and the vertical entries past its own; a map over zero words is `new`'s. +#[test] +fn a_reset_writes_its_tables_over_the_maps() { + let none = RateMapDescriptor::new([64, 32]); + let fresh = RasterizationRateMap::new(&none).unwrap(); + assert_eq!( + fnv(&fresh.to_bytes()), + 0x7ead_0d0b_02b1_afdb, + "a fresh map of none" + ); + let zeros = vec![0u32; format::WORDS as usize]; + assert_eq!( + RasterizationRateMap::new_over(&none, &zeros), + Ok(fresh.clone()) + ); + let cases: [(&[RateMapLayerDescriptor], u64, u64); 3] = [ + ( + &[layer(&[0.5], &[0.5])], + 0xb906_457e_1eb4_0870, + 0x03b3_2978_774d_4131, + ), + ( + &[layer(&[0.5], &[0.5]), layer(&[0.25], &[0.25])], + 0x2b20_361b_8ed2_a324, + 0x5fb1_b833_f7c6_3085, + ), + ( + &[layer(&[1.0], &[1.0])], + 0x3185_559d_f1c5_12a1, + 0xcd66_ddc9_de96_0d01, + ), + ]; + for (layers, before, after) in cases { + let earlier = map([100, 60], layers); + assert_eq!(fnv(&earlier.to_bytes()), before, "{layers:?}"); + let reset = RasterizationRateMap::new_over(&none, earlier.words()).unwrap(); + assert_eq!(fnv(&reset.to_bytes()), after, "{layers:?} reset to none"); + assert_eq!(reset.words()[..4104], earlier.words()[..4104]); + assert_eq!(reset.layer_count(), 0); + assert_eq!(reset.vertical(), fresh.vertical()); + } +} diff --git a/crates/metal2vulkan/src/bind/ycbcr_write.rs b/crates/metal2vulkan/src/bind/ycbcr_write.rs index 6064b3268..dca544071 100644 --- a/crates/metal2vulkan/src/bind/ycbcr_write.rs +++ b/crates/metal2vulkan/src/bind/ycbcr_write.rs @@ -26,9 +26,10 @@ //! red, each `round(clamp(v, 0, 1) · (2^b - 1))` of the exact product, to nearest (a NaN 0). //! The `float` product rounded instead misses about 1 in 14 values within 3 ulps of a tie. //! -//! The `_sRGB` twins' writes follow none of these (their linear value steps by `1 / 8192`, then a -//! curve that is not the reads' inverse), and the packed formats' writes are stored by the M4 and -//! dropped by the M3: neither is encoded here ([`ycbcr_write`] answers `None`). +//! The `_sRGB` twins' writes follow none of these (their linear value is taken through a +//! linear-to-sRGB curve within a code of the exact curve, not the reads' inverse), and the packed +//! formats' writes are dropped (the M3 Max under macOS 27.0.1; an M4 stores them): neither is +//! encoded here ([`ycbcr_write`] answers `None`). //! //! **A render pass's store** (our own probes over CoreVideo `420v`, `420f`, `422v`, `444v` and //! `444f` surfaces on an Apple M4 under macOS 27.0.1: every byte of the converted 8-bit formats' diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index 0eca00167..962584aa1 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -60,7 +60,7 @@ mod tests; /// unchanged version, and its bless records the version. Independent of the crate's version and of /// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no /// history. -pub const SEMANTICS_VERSION: u32 = 1816; +pub const SEMANTICS_VERSION: u32 = 1817; /// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the /// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another @@ -70,7 +70,7 @@ pub const SEMANTICS_VERSION: u32 = 1816; /// re-typed in an encoded type, its `codec` body or its `envelope`. A variant removed while its tag /// stays unused needs no bump: an entry holding it fails to decode, which is a miss. The commit that /// bumps it says what changed; this comment keeps no history. -pub const ARTIFACT_FORMAT_VERSION: u32 = 441; +pub const ARTIFACT_FORMAT_VERSION: u32 = 442; /// The version of what this crate's runtime does with a compiled pipeline: instantiating a binding /// plan (`BindingPlan::instantiate_*`: descriptor ranges, push bytes, root, argument, and handle @@ -93,7 +93,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 441; /// 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 = 1509; +pub const RUNTIME_VERSION: u32 = 1510; /// 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 diff --git a/crates/metal2vulkan/src/metal/format/mod.rs b/crates/metal2vulkan/src/metal/format/mod.rs index 65b5977f3..d7749cee5 100644 --- a/crates/metal2vulkan/src/metal/format/mod.rs +++ b/crates/metal2vulkan/src/metal/format/mod.rs @@ -1962,18 +1962,22 @@ pub fn ycbcr(pf: PixelFormat) -> bool { } /// Whether Metal completes a function's writes to a texture of `pf` and stores nothing: the -/// 4:2:2 formats and the YCbCr formats ([`ycbcr`]) whose chroma is subsampled, 4:2:0 and 4:2:2 (a +/// 4:2:2 formats, the YCbCr formats ([`ycbcr`]) whose chroma is subsampled, 4:2:0 and 4:2:2 (a /// kernel's write leaves both planes' bytes as they were, and Metal's validation stops the -/// binding). A storage slot a function only writes takes its neutral there (`bind::plan`), which -/// the writes leave as Metal leaves the texture. +/// binding), and the packed ones, `YCBCR10_444_2P_PACKED` and its `_sRGB` twin among them (the +/// M3 Max under macOS 27.0.1, our probe `ycw` over `p444` and `pf44` surfaces: every byte of both +/// planes kept, the command buffer completed; an Apple M4 stores them). A storage slot a function +/// only writes takes its neutral there (`bind::plan`), which the writes leave as Metal leaves the +/// texture. /// -/// A 4:4:4 YCbCr format's writes are not dropped: Metal stores each texel's codes into both -/// planes, which a slot that only writes one of [`ycbcr_writes_stored`] +/// An unpacked 4:4:4 YCbCr format's writes are not dropped: Metal stores each texel's codes into +/// both planes, which a slot that only writes one of [`ycbcr_writes_stored`] /// does as Metal does; a slot that writes another is refused (`storage_choice`). pub fn writes_dropped(pf: PixelFormat) -> bool { matches!(pf, PixelFormat::GBGR422 | PixelFormat::BGRG422) || (ycbcr(pf) - && ycbcr_format(pf).is_some_and(|f| f.subsampling != ChromaSubsampling::Chroma444)) + && ycbcr_format(pf) + .is_some_and(|f| f.subsampling != ChromaSubsampling::Chroma444 || f.packed)) } /// Whether a function's writes to a two-plane YCbCr texture of `pf` ([`ycbcr`]) store into its @@ -1983,8 +1987,9 @@ pub fn writes_dropped(pf: PixelFormat) -> bool { /// `RGB8_444_2P` and `RGB10_444_2P`. Metal stores each written texel's luma code into the luma /// plane and its own chroma pair into the chroma plane, the codes `bind::ycbcr_write` states /// (an Apple M4 under macOS 27.0.1, and an Apple M3 Max under macOS 26.7, byte for byte the same). -/// Not the `_sRGB` twins, whose writes no arithmetic found matches, nor the packed formats, whose -/// writes the M3 drops and the M4 stores: a slot that writes one is refused (`storage_choice`). +/// Not the `_sRGB` twins, whose writes no arithmetic found matches (a slot that writes one is +/// refused, `storage_choice`), nor the packed formats, whose writes Metal drops +/// ([`writes_dropped`]). pub fn ycbcr_writes_stored(pf: PixelFormat) -> bool { ycbcr(pf) && ycbcr_format(pf).is_some_and(|f| { diff --git a/crates/metal2vulkan/src/metal/format/tests.rs b/crates/metal2vulkan/src/metal/format/tests.rs index 232a844c0..8aea7abe2 100644 --- a/crates/metal2vulkan/src/metal/format/tests.rs +++ b/crates/metal2vulkan/src/metal/format/tests.rs @@ -2525,22 +2525,24 @@ fn ycbcr_formats_are_the_two_plane_family_as_named() { assert_eq!(described, 69); } -/// Metal drops a function's writes to a 4:2:0 or 4:2:2 two-plane YCbCr format and stores a -/// 4:4:4 one's into both planes: only the subsampled formats' writes are -/// dropped, and a storage slot of a 4:4:4 format is refused, typed, as a read one is. +/// Metal drops a function's writes to a 4:2:0, 4:2:2 or packed two-plane YCbCr format and +/// stores an unpacked 4:4:4 one's into both planes: only the subsampled and packed formats' +/// writes are dropped. #[test] -fn only_subsampled_ycbcr_formats_drop_writes() { +fn only_subsampled_and_packed_ycbcr_formats_drop_writes() { let mut four_four_four = 0; for &pf in PixelFormat::ALL { let Some(f) = ycbcr_format(pf).filter(|_| ycbcr(pf)) else { continue; }; - let full = f.subsampling == ChromaSubsampling::Chroma444; - assert_eq!(writes_dropped(pf), !full, "{pf:?}"); - four_four_four += usize::from(full); + let stored = f.subsampling == ChromaSubsampling::Chroma444 && !f.packed; + assert_eq!(writes_dropped(pf), !stored, "{pf:?}"); + four_four_four += usize::from(stored); } assert!(four_four_four >= 6, "{four_four_four}"); assert!(writes_dropped(PixelFormat::GBGR422) && writes_dropped(PixelFormat::YCBCR84202P)); + assert!(writes_dropped(PixelFormat::YCBCR104442PPACKED)); + assert!(writes_dropped(PixelFormat::YCBCR104442PPACKEDSRGB)); assert!(!writes_dropped(PixelFormat::YCBCR84442P) && !writes_dropped(PixelFormat::RGB104442P)); } diff --git a/crates/metal2vulkan/tests/golden_hashes.tsv b/crates/metal2vulkan/tests/golden_hashes.tsv index c366afd88..f24df107b 100644 --- a/crates/metal2vulkan/tests/golden_hashes.tsv +++ b/crates/metal2vulkan/tests/golden_hashes.tsv @@ -129,8 +129,8 @@ engine/a4_matrix_filled.air.ll 4136c103377688fb a4_matrix_filled 8b3d739bb3841f0 engine/a4_matrix_filled.ll 96e544d4576cf2d7 a4_matrix_filled 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 724a049b2628897d 724a049b2628897d 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 724a049b2628897d 724a049b2628897d 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 8b3d739bb3841f06 724a049b2628897d 724a049b2628897d 724a049b2628897d engine/a4_pixel_fetch.air.ll a0de2f6d9924ff5f a4_pixel_fetch 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 4522b5e827b04763 4522b5e827b04763 4522b5e827b04763 433137853cce174c 433137853cce174c 433137853cce174c 4522b5e827b04763 4522b5e827b04763 4522b5e827b04763 engine/a4_pixel_fetch.ll 6091db21743168f7 a4_pixel_fetch 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 433137853cce174c 4522b5e827b04763 4522b5e827b04763 4522b5e827b04763 433137853cce174c 433137853cce174c 433137853cce174c 4522b5e827b04763 4522b5e827b04763 4522b5e827b04763 -engine/a4_query_dynamic_level.air.ll 044590d6ebad8d8e a4_query_dynamic_level bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 60902a46f91df5f2 60902a46f91df5f2 60902a46f91df5f2 60902a46f91df5f2 bafb9db49adb3055 d9b3542c0eb440cc bafb9db49adb3055 bafb9db49adb3055 d9b3542c0eb440cc 60902a46f91df5f2 60902a46f91df5f2 d9b3542c0eb440cc d9b3542c0eb440cc d9b3542c0eb440cc -engine/a4_query_dynamic_level.ll 7d0697df1ba38bf6 a4_query_dynamic_level bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 bafb9db49adb3055 60902a46f91df5f2 60902a46f91df5f2 60902a46f91df5f2 60902a46f91df5f2 bafb9db49adb3055 d9b3542c0eb440cc bafb9db49adb3055 bafb9db49adb3055 d9b3542c0eb440cc 60902a46f91df5f2 60902a46f91df5f2 d9b3542c0eb440cc d9b3542c0eb440cc d9b3542c0eb440cc +engine/a4_query_dynamic_level.air.ll 044590d6ebad8d8e a4_query_dynamic_level 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 86caa4c623b1ef21 86caa4c623b1ef21 86caa4c623b1ef21 86caa4c623b1ef21 803980748c5b01f6 a2e8b284bd1952c3 803980748c5b01f6 803980748c5b01f6 a2e8b284bd1952c3 86caa4c623b1ef21 86caa4c623b1ef21 a2e8b284bd1952c3 a2e8b284bd1952c3 a2e8b284bd1952c3 +engine/a4_query_dynamic_level.ll 7d0697df1ba38bf6 a4_query_dynamic_level 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 803980748c5b01f6 86caa4c623b1ef21 86caa4c623b1ef21 86caa4c623b1ef21 86caa4c623b1ef21 803980748c5b01f6 a2e8b284bd1952c3 803980748c5b01f6 803980748c5b01f6 a2e8b284bd1952c3 86caa4c623b1ef21 86caa4c623b1ef21 a2e8b284bd1952c3 a2e8b284bd1952c3 a2e8b284bd1952c3 engine/a4_sample_grad.air.ll b84bc3dd56fd798a a4_sample_grad 861f34a29dc136ee 861f34a29dc136ee bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 861f34a29dc136ee 861f34a29dc136ee bf2925dad0c5bc97 896ca04e783323d7 229cefabc1dc4fa7 229cefabc1dc4fa7 bf2925dad0c5bc97 bf2925dad0c5bc97 861f34a29dc136ee 896ca04e783323d7 896ca04e783323d7 896ca04e783323d7 engine/a4_sample_grad.ll 4aaa5d6e01e79a9f a4_sample_grad 861f34a29dc136ee 861f34a29dc136ee bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 bf2925dad0c5bc97 861f34a29dc136ee 861f34a29dc136ee bf2925dad0c5bc97 896ca04e783323d7 229cefabc1dc4fa7 229cefabc1dc4fa7 bf2925dad0c5bc97 bf2925dad0c5bc97 861f34a29dc136ee 896ca04e783323d7 896ca04e783323d7 896ca04e783323d7 engine/a4_select_is_null.air.ll 5d4b6a5ff412e937 a4_select_is_null 752be30caf40d3ee 752be30caf40d3ee d1d8bca67b4a69c6 d1d8bca67b4a69c6 d1d8bca67b4a69c6 d1d8bca67b4a69c6 80ddb24ee7a543b9 80ddb24ee7a543b9 fbe38e9634a2377c fbe38e9634a2377c d1d8bca67b4a69c6 af78b954b6cdf378 d4d58d4e06a15bb2 d4d58d4e06a15bb2 ece6d0e613846c11 80ddb24ee7a543b9 fbe38e9634a2377c 20c3bad25248cf1b 20c3bad25248cf1b 20c3bad25248cf1b @@ -1516,6 +1516,22 @@ engine/primitive_ids.ll 15d149579018a835 pi_five a4f6636b9f9bd7cc a4f6636b9f9bd7 engine/primitive_ids.ll 15d149579018a835 pi_ids 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 803ab92051eb0bf6 803ab92051eb0bf6 803ab92051eb0bf6 8f3edb8efa909da1 8f3edb8efa909da1 8f3edb8efa909da1 e9f024dab29da268 e9f024dab29da268 e9f024dab29da268 engine/primitive_ids.ll 15d149579018a835 pi_place 3cb7e11d27c7e2c5 3cb7e11d27c7e2c5 11e48b8733a55845 11e48b8733a55845 075d8f8082aa0ef9 075d8f8082aa0ef9 1852d6aff5bf035e 1852d6aff5bf035e 07e32a384f3df198 07e32a384f3df198 075d8f8082aa0ef9 60ddcfe7a0142881 3cb7e11d27c7e2c5 3cb7e11d27c7e2c5 60ddcfe7a0142881 1852d6aff5bf035e 07e32a384f3df198 60ddcfe7a0142881 60ddcfe7a0142881 60ddcfe7a0142881 engine/primitive_ids.ll 15d149579018a835 pi_points f04518f630672ff5 f04518f630672ff5 f88a4dea1410cdc1 f88a4dea1410cdc1 1f542d6393228929 1f542d6393228929 5cabdf0493bbc2d6 5cabdf0493bbc2d6 cd2888ab40c9dc60 cd2888ab40c9dc60 1f542d6393228929 416d38cbc9fffdc6 f04518f630672ff5 f04518f630672ff5 416d38cbc9fffdc6 5cabdf0493bbc2d6 cd2888ab40c9dc60 416d38cbc9fffdc6 416d38cbc9fffdc6 416d38cbc9fffdc6 +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_counter 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 847a596242a55998 Unsupported{StageStoresAndAtomics; AnyOf[[Feature(FragmentStoresAndAtomics)]]} +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_early 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_read 4afb392b2e94484c 4afb392b2e94484c 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 4afb392b2e94484c 4afb392b2e94484c 3f614cef83b5bf7e fcb6c314f7bb6063 8c0579e2da67b77f 8c0579e2da67b77f 3f614cef83b5bf7e 3f614cef83b5bf7e 4afb392b2e94484c 2853348b061d7f6e 2853348b061d7f6e 2853348b061d7f6e +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_read_depth 1d4d4ac7dfb48a5f 1d4d4ac7dfb48a5f ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 1d4d4ac7dfb48a5f 1d4d4ac7dfb48a5f ece353760cbbb639 ece353760cbbb639 1d4d4ac7dfb48a5f 1d4d4ac7dfb48a5f ece353760cbbb639 ece353760cbbb639 1d4d4ac7dfb48a5f f73ef95129b6c758 f73ef95129b6c758 f73ef95129b6c758 +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_read_depth_samples c6114c47e166dbe0 c6114c47e166dbe0 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 c6114c47e166dbe0 c6114c47e166dbe0 490fd55587f5a250 490fd55587f5a250 c6114c47e166dbe0 c6114c47e166dbe0 490fd55587f5a250 490fd55587f5a250 c6114c47e166dbe0 4661f824a2d540bf 4661f824a2d540bf 4661f824a2d540bf +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_read_samples e3f3a79729e9e413 e3f3a79729e9e413 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 e3f3a79729e9e413 e3f3a79729e9e413 774e87b7fcff1db0 2820425e1a838f7d 4ab3934e68d9e369 4ab3934e68d9e369 774e87b7fcff1db0 774e87b7fcff1db0 e3f3a79729e9e413 5c5e0eb3ca04b88a 5c5e0eb3ca04b88a 5c5e0eb3ca04b88a +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_vertex dc3cbafea6f760d7 dc3cbafea6f760d7 eefed683ec31b693 eefed683ec31b693 e533e09684ee7623 e533e09684ee7623 eefed683ec31b693 eefed683ec31b693 dc3cbafea6f760d7 dc3cbafea6f760d7 e533e09684ee7623 e533e09684ee7623 dc3cbafea6f760d7 dc3cbafea6f760d7 e533e09684ee7623 eefed683ec31b693 dc3cbafea6f760d7 e533e09684ee7623 e533e09684ee7623 e533e09684ee7623 +engine/psc_sample_coverage.air.ll 84ff7935cd9dcde9 psc_white c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 +engine/psc_sample_coverage.ll 544bfe843b406549 psc_counter 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 4030f09442967e98 847a596242a55998 Unsupported{StageStoresAndAtomics; AnyOf[[Feature(FragmentStoresAndAtomics)]]} +engine/psc_sample_coverage.ll 544bfe843b406549 psc_early 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca 3196aff06e8865ca +engine/psc_sample_coverage.ll 544bfe843b406549 psc_read 4afb392b2e94484c 4afb392b2e94484c 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 3f614cef83b5bf7e 4afb392b2e94484c 4afb392b2e94484c 3f614cef83b5bf7e fcb6c314f7bb6063 8c0579e2da67b77f 8c0579e2da67b77f 3f614cef83b5bf7e 3f614cef83b5bf7e 4afb392b2e94484c 2853348b061d7f6e 2853348b061d7f6e 2853348b061d7f6e +engine/psc_sample_coverage.ll 544bfe843b406549 psc_read_depth 1d4d4ac7dfb48a5f 1d4d4ac7dfb48a5f ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 ece353760cbbb639 1d4d4ac7dfb48a5f 1d4d4ac7dfb48a5f ece353760cbbb639 ece353760cbbb639 1d4d4ac7dfb48a5f 1d4d4ac7dfb48a5f ece353760cbbb639 ece353760cbbb639 1d4d4ac7dfb48a5f f73ef95129b6c758 f73ef95129b6c758 f73ef95129b6c758 +engine/psc_sample_coverage.ll 544bfe843b406549 psc_read_depth_samples c6114c47e166dbe0 c6114c47e166dbe0 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 490fd55587f5a250 c6114c47e166dbe0 c6114c47e166dbe0 490fd55587f5a250 490fd55587f5a250 c6114c47e166dbe0 c6114c47e166dbe0 490fd55587f5a250 490fd55587f5a250 c6114c47e166dbe0 4661f824a2d540bf 4661f824a2d540bf 4661f824a2d540bf +engine/psc_sample_coverage.ll 544bfe843b406549 psc_read_samples e3f3a79729e9e413 e3f3a79729e9e413 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 774e87b7fcff1db0 e3f3a79729e9e413 e3f3a79729e9e413 774e87b7fcff1db0 2820425e1a838f7d 4ab3934e68d9e369 4ab3934e68d9e369 774e87b7fcff1db0 774e87b7fcff1db0 e3f3a79729e9e413 5c5e0eb3ca04b88a 5c5e0eb3ca04b88a 5c5e0eb3ca04b88a +engine/psc_sample_coverage.ll 544bfe843b406549 psc_vertex dc3cbafea6f760d7 dc3cbafea6f760d7 eefed683ec31b693 eefed683ec31b693 e533e09684ee7623 e533e09684ee7623 eefed683ec31b693 eefed683ec31b693 dc3cbafea6f760d7 dc3cbafea6f760d7 e533e09684ee7623 e533e09684ee7623 dc3cbafea6f760d7 dc3cbafea6f760d7 e533e09684ee7623 eefed683ec31b693 dc3cbafea6f760d7 e533e09684ee7623 e533e09684ee7623 e533e09684ee7623 +engine/psc_sample_coverage.ll 544bfe843b406549 psc_white c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 c77e5bfcbb7332e7 engine/quad_shuffle.air.ll 9fbe380dd247dd57 quad_shuffle_rotate 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 878c94ee8ea7598c 878c94ee8ea7598c 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 878c94ee8ea7598c 878c94ee8ea7598c 10b5dcee5cde8a46 10b5dcee5cde8a46 d7fa00177cf96ba9 10b5dcee5cde8a46 10b5dcee5cde8a46 878c94ee8ea7598c 878c94ee8ea7598c 878c94ee8ea7598c engine/quad_shuffle.ll f3a503d28be66f78 quad_shuffle_rotate 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 878c94ee8ea7598c 878c94ee8ea7598c 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 10b5dcee5cde8a46 878c94ee8ea7598c 878c94ee8ea7598c 10b5dcee5cde8a46 10b5dcee5cde8a46 d7fa00177cf96ba9 10b5dcee5cde8a46 10b5dcee5cde8a46 878c94ee8ea7598c 878c94ee8ea7598c 878c94ee8ea7598c engine/rch_guarded_effects.air.ll aee9d4b229fefc5d rch_guarded_atomic 33b9b566dfeed28d 33b9b566dfeed28d 15a9ff1b268a417d 15a9ff1b268a417d 15a9ff1b268a417d 15a9ff1b268a417d 15a9ff1b268a417d 15a9ff1b268a417d 33b9b566dfeed28d 33b9b566dfeed28d 15a9ff1b268a417d 57226500711df3a9 452b2916c9833fc8 452b2916c9833fc8 15a9ff1b268a417d 15a9ff1b268a417d 33b9b566dfeed28d e7ee97c9c5247426 3c6a8207691f2be6 Unsupported{StageStoresAndAtomics; AnyOf[[Feature(FragmentStoresAndAtomics)]]} @@ -2184,14 +2200,14 @@ engine/tessellation.ll 6ef018757a5924dd tess_triangle_points NeedsInput{VertexDe engine/tessellation.ll 6ef018757a5924dd tess_whole_point NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} NeedsInput{VertexDescriptor { attribute: 0 }} engine/texture_ops.air.ll c9a815efad8668b2 cube_faces 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 c566e4606cfac03b c566e4606cfac03b c566e4606cfac03b 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 220a2d1c559a93ca 220a2d1c559a93ca 220a2d1c559a93ca engine/texture_ops.air.ll c9a815efad8668b2 depth_ms 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 8c73174f2b88f8c1 8c73174f2b88f8c1 8c73174f2b88f8c1 36debaba90a54469 36debaba90a54469 36debaba90a54469 41513a07dc6f1ca9 41513a07dc6f1ca9 41513a07dc6f1ca9 -engine/texture_ops.air.ll c9a815efad8668b2 queries 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 +engine/texture_ops.air.ll c9a815efad8668b2 queries a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d engine/texture_ops.air.ll c9a815efad8668b2 read_write_fence d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} d22465987d2898c5 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} aeef574af5c3ac8f aeef574af5c3ac8f d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} engine/texture_ops.air.ll c9a815efad8668b2 short_texels 744da971b32b401c 744da971b32b401c 744da971b32b401c 744da971b32b401c 75d8b134adbcf17e 75d8b134adbcf17e ea7eef9b3c5b3838 ea7eef9b3c5b3838 ea7eef9b3c5b3838 ea7eef9b3c5b3838 75d8b134adbcf17e d02d977be4b9536a d0965a5c139d6d2b d0965a5c139d6d2b 2c067b15ee980c99 75d8b134adbcf17e 75d8b134adbcf17e NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} 649111b384bcb1df NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} engine/texture_ops.air.ll c9a815efad8668b2 texel_buffers e288f99f373d557c e288f99f373d557c 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 40f06403c3e8407d 40f06403c3e8407d 72561d92fb5dcda2 b0b4518ba0108965 e0fd0a7f91797868 e0fd0a7f91797868 72561d92fb5dcda2 72561d92fb5dcda2 40f06403c3e8407d NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} b0b4518ba0108965 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} engine/texture_ops.air.ll c9a815efad8668b2 write_lod 9b56c54eec34d4b0 9b56c54eec34d4b0 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af 7459ba3762d8c9af Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} 9b56c54eec34d4b0 9b56c54eec34d4b0 f029c76ea7980a39 f029c76ea7980a39 f029c76ea7980a39 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} 7459ba3762d8c9af Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} engine/texture_ops.ll bb3c9a00be3b6bbb cube_faces 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 c566e4606cfac03b c566e4606cfac03b c566e4606cfac03b 2f2de3057dd04175 2f2de3057dd04175 2f2de3057dd04175 220a2d1c559a93ca 220a2d1c559a93ca 220a2d1c559a93ca engine/texture_ops.ll bb3c9a00be3b6bbb depth_ms 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 36debaba90a54469 8c73174f2b88f8c1 8c73174f2b88f8c1 8c73174f2b88f8c1 36debaba90a54469 36debaba90a54469 36debaba90a54469 41513a07dc6f1ca9 41513a07dc6f1ca9 41513a07dc6f1ca9 -engine/texture_ops.ll bb3c9a00be3b6bbb queries 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 01986ffc62bab410 +engine/texture_ops.ll bb3c9a00be3b6bbb queries a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d a2a5b0d0bb4feb3d engine/texture_ops.ll bb3c9a00be3b6bbb read_write_fence d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} d22465987d2898c5 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} aeef574af5c3ac8f aeef574af5c3ac8f d22465987d2898c5 d22465987d2898c5 d22465987d2898c5 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} engine/texture_ops.ll bb3c9a00be3b6bbb short_texels 744da971b32b401c 744da971b32b401c 744da971b32b401c 744da971b32b401c 75d8b134adbcf17e 75d8b134adbcf17e ea7eef9b3c5b3838 ea7eef9b3c5b3838 ea7eef9b3c5b3838 ea7eef9b3c5b3838 75d8b134adbcf17e d02d977be4b9536a d0965a5c139d6d2b d0965a5c139d6d2b 2c067b15ee980c99 75d8b134adbcf17e 75d8b134adbcf17e NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} 649111b384bcb1df NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} engine/texture_ops.ll bb3c9a00be3b6bbb texel_buffers e288f99f373d557c e288f99f373d557c 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 72561d92fb5dcda2 40f06403c3e8407d 40f06403c3e8407d 72561d92fb5dcda2 b0b4518ba0108965 e0fd0a7f91797868 e0fd0a7f91797868 72561d92fb5dcda2 72561d92fb5dcda2 40f06403c3e8407d NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} b0b4518ba0108965 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 1 } }} @@ -2296,8 +2312,8 @@ engine/ttg_tile_simd_blur.air.ll e43062e87cc0b5db ttg_tile_simd_blur NeedsInput{ engine/ttg_tile_simd_blur.ll 01cb33eff004e677 ttg_tile_simd_blur NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} NeedsInput{TileAttachments} engine/txt_level_cube_write.air.ll 02649cc8d14a3eca txt_level_cube_write 465534fad8a44414 465534fad8a44414 1f7616abf0ab6be8 1f7616abf0ab6be8 ab69710656178bfc ab69710656178bfc 203836c2f0c99ff1 203836c2f0c99ff1 203836c2f0c99ff1 203836c2f0c99ff1 ab69710656178bfc Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} 465534fad8a44414 465534fad8a44414 832b7b50017b18c2 f838f66a18f53e1e f838f66a18f53e1e NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} f232141bef53234e Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} engine/txt_level_cube_write.ll 0db90a37d6dbdb4e txt_level_cube_write 465534fad8a44414 465534fad8a44414 1f7616abf0ab6be8 1f7616abf0ab6be8 ab69710656178bfc ab69710656178bfc 203836c2f0c99ff1 203836c2f0c99ff1 203836c2f0c99ff1 203836c2f0c99ff1 ab69710656178bfc Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} 465534fad8a44414 465534fad8a44414 832b7b50017b18c2 f838f66a18f53e1e f838f66a18f53e1e NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} f232141bef53234e Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} -engine/txt_level_queries.air.ll 87338d879a0c8a88 txt_level_queries 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 1374ef8f83a07210 1374ef8f83a07210 1374ef8f83a07210 1374ef8f83a07210 8592e16820c4261f Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} 8592e16820c4261f 8592e16820c4261f d8c1203dfa56ef3a 9b0452e1d0650820 9b0452e1d0650820 1a74f812318df9c3 ee1e7004afdf54a5 Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} -engine/txt_level_queries.ll 04ecaa2848338f74 txt_level_queries 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 8592e16820c4261f 1374ef8f83a07210 1374ef8f83a07210 1374ef8f83a07210 1374ef8f83a07210 8592e16820c4261f Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} 8592e16820c4261f 8592e16820c4261f d8c1203dfa56ef3a 9b0452e1d0650820 9b0452e1d0650820 1a74f812318df9c3 ee1e7004afdf54a5 Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} +engine/txt_level_queries.air.ll 87338d879a0c8a88 txt_level_queries b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 c85a0786f8ee9f65 c85a0786f8ee9f65 c85a0786f8ee9f65 c85a0786f8ee9f65 b3be9181e3215888 0e494d3ec5d550db b3be9181e3215888 b3be9181e3215888 0e494d3ec5d550db c85a0786f8ee9f65 c85a0786f8ee9f65 0e494d3ec5d550db 0e494d3ec5d550db 0e494d3ec5d550db +engine/txt_level_queries.ll 04ecaa2848338f74 txt_level_queries b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 b3be9181e3215888 c85a0786f8ee9f65 c85a0786f8ee9f65 c85a0786f8ee9f65 c85a0786f8ee9f65 b3be9181e3215888 0e494d3ec5d550db b3be9181e3215888 b3be9181e3215888 0e494d3ec5d550db c85a0786f8ee9f65 c85a0786f8ee9f65 0e494d3ec5d550db 0e494d3ec5d550db 0e494d3ec5d550db engine/txt_level_read_write.air.ll 7f6874edec809f67 txt_level_read_write 5fdea52ccae45380 5fdea52ccae45380 195049444c463f29 195049444c463f29 f2c3fafa332282ac f2c3fafa332282ac 6e0a445c91104987 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} f2c3fafa332282ac Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} dd1e7be6059a9adf dd1e7be6059a9adf a87a4ee3944d1e11 40ae38fbc71188df b4a01dd2f69cf670 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} engine/txt_level_read_write.ll 39311b634ca68b4a txt_level_read_write 5fdea52ccae45380 5fdea52ccae45380 195049444c463f29 195049444c463f29 f2c3fafa332282ac f2c3fafa332282ac 6e0a445c91104987 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} f2c3fafa332282ac Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} dd1e7be6059a9adf dd1e7be6059a9adf a87a4ee3944d1e11 40ae38fbc71188df b4a01dd2f69cf670 NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} engine/txt_level_slice.air.ll 9de26515cd9bdd2a txt_level_slice 5c555cd1d8619583 5c555cd1d8619583 5c555cd1d8619583 5c555cd1d8619583 44c57949ec47ada9 44c57949ec47ada9 f1cdac9ea8157782 f1cdac9ea8157782 f1cdac9ea8157782 f1cdac9ea8157782 44c57949ec47ada9 Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} 019f9855664a2d3a 019f9855664a2d3a 2630e45acc83be8e b2fb8d904094b58e b2fb8d904094b58e NeedsInput{StorageTextureFormat { slot: SlotRef { stage: Kernel, class: Texture, index: 0 } }} 5ec82b9cb07f2d7e Unsupported{Lowering(Texture); AnyOf[[Feature(ShaderStorageImageArrayNonUniformIndexing)]]} diff --git a/docs/API.md b/docs/API.md index 2cad59cd9..c7ee3f2f2 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1970,9 +1970,9 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound. gives the older release's: it can stop or refuse a texture or a dispatch the host's Metal makes, and never makes one the older release stops. - `metal2vulkan-degrade-unreached-tiles-rewritten` (precision). `UnreachedTilesRewritten`: A render - pass that loads a color attachment of an extended-range or padded 10-bit format (`BGR10_XR`, - `BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and their sRGB twins, and - `RGB10A2Unorm_sRGB`), or under + pass that loads a color attachment of an extended-range, padded 10-bit or bfloat format + (`BGR10_XR`, `BGRA10_XR`, `RGB10A8_2P_XR10`, `R10Unorm_X6`, `RG10Unorm_X12` and their sRGB twins, + `RGB10A2Unorm_sRGB`, `R16Bfloat`, `RG16Bfloat` and `RGBA16Bfloat`), or under `TileStorePolicy::Exact` of a signed normalized format or `RGB9E5Float`, stores it and draws, whose load pass rewrites every 32 x 32 tile of its render area: Metal's pass rewrites only the tiles a draw's primitives reach, and every tile only where a color attachment of the pass @@ -1981,12 +1981,21 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound. (BGR10_XR's bits 30 and 31 ones, BGRA10_XR's low six bits of each field and the two-plane color word's top two bits zeros) and BGRA10_XR alpha codes clamped to [384, 894], so an out-of-range raw alpha reads back changed, a padded word's low six bits zeroed (an sRGB twin's code moved through - Metal's table) and, under the exact tile store, a signed normalized minimum code raised and an + Metal's table), a bfloat code moved through half (out of half's range to an infinity or zero, a + NaN to 0x7fc0) and, under the exact tile store, a signed normalized minimum code raised and an RGB9E5Float word normalized; the tiles a draw reaches are Metal's. - `metal2vulkan-degrade-zero-layer-map-after-release` (precision). `ZeroLayerMapAfterRelease`: A draw in a render pass over a rasterization-rate map of no layers that was made after the device - released a map of one or more layers. Cost: the draws write nothing, where Metal draws rows of the - pass (a 64-pixel map's rows 0 to 15, at the positions of a pass with no map). + released a map of one or more layers, or reset from one of layers. Cost: the draws write nothing, + where Metal draws rows of the pass (a 64-pixel map's rows 0 to 15, at the positions of a pass + with no map). +- `metal2vulkan-degrade-rate-map-reset-unencoded` (precision). `RateMapResetUnencoded`: A render + pass over a rasterization-rate map reset (`RasterizationRateMap::reset_using_descriptor`) after + the pass took it and before its command buffer was submitted, in an encoder the runtime could not + encode again (it kept no log: a command predication's command buffer, a render encoder opened + while a buffer of the device was detached, or one that left work for a host step). Announced at + the commit, or at the reset where the command buffer was committed. Cost: the pass draws by the + map as it took it, where Metal's GPU draws by the map as reset. - `metal2vulkan-degrade-heap-texture-lossless-layout` (precision). `HeapTextureLosslessLayout`: A texture made in a heap over host pages (`new_heap_with_bytes_no_copy`), or a depth or stencil texture made in any heap as a shadow of Metal's tiles (on a driver that lays such images apart from @@ -3164,12 +3173,25 @@ each item named states the rule in full. exit's status and one line on standard error: the exit handlers registered before the runtime's last registration (a terminal's restore, say) do not run, where Metal's exit runs them. +**Two-plane YCbCr textures** + +- **A view of an `_sRGB` twin as a 2D array reads its luma codes**, as its converted format's + view does, where Metal's reads change from run to run. + **Rasterization-rate maps** -- **A map of no layers answers its coordinate maps**, where Metal ends the process. +- **A map of no layers refuses its coordinate maps, and a mutable map not yet reset its + physical-to-screen map**, where Metal ends the process. - **A screen past 16384 pixels a side is refused**, where Apple's compile crashes or returns a corrupt size. - **A parameter-data copy Metal makes unsafely is refused**: into a `Private` buffer, or past the buffer's length. -- **A physical size past the map's layers has width 0.** +- **A physical size past the map's layers has width 0**, but after a reset to fewer layers, which + keeps the earlier layers' widths, as Metal does. Past layer 1 Metal reads the map's other fields and the + memory after them (an M3 Max: at layer 2 the vertical extent, at 3 and 4 the screen's sides), and + a layer near the top of the range ends the process. +- **A mutable map's pass stops at the physical size**, where Metal rasterizes past the screen edge + (an M3 Max: a 64-pixel half-rate map's pass to 49 by 49 pixels); announced with + `rasterization-rate-map`. +- **A pass of no draws over a mutable map stores its clear**, where Metal's GPU hangs. - **A rate-mapped pass draws region by region, and refuses a cutting scissor.** diff --git a/docs/REFUSALS.md b/docs/REFUSALS.md index c9db51de9..366c4d2a0 100644 --- a/docs/REFUSALS.md +++ b/docs/REFUSALS.md @@ -14,14 +14,14 @@ Columns: - `none`: no public API path: malformed or non-Metal input, Apple-private calls, or a cap no valid program of ordinary size meets; - `?`: not assessed yet. -Generated at `545ff3a77`. +Generated at `b2cb69266`. ## Totals | Kind | Variants | With a site | Reach system | Reach app | Reach rare | Reach none | Unassessed | |---|---|---|---|---|---|---|---| | Translator and front-end refusals | 126 | 126 | 6 | 33 | 70 | 17 | 0 | -| Runtime gaps | 67 | 67 | 1 | 8 | 43 | 15 | 0 | +| Runtime gaps | 66 | 66 | 1 | 8 | 43 | 14 | 0 | | Apple-only calls | 5 | 5 | 0 | 0 | 0 | 5 | 0 | | Binder refusals at a device limit | 9 | 9 | 0 | 1 | 7 | 1 | 0 | | Translation caps | 14 | 14 | 0 | 0 | 7 | 7 | 0 | @@ -48,7 +48,7 @@ Generated at `545ff3a77`. | `SimdWidth` | Simdgroup width 32 is not achievable for this usage, stage, and device | devices without VkProperty::MetalFragmentSimdgroups; devices without a capability the site computes (`width_needs(stage, st)`) | 2: `crates/metal2vulkan/src/device/subgroup.rs:377`, `crates/metal2vulkan/src/lower/simd/mod.rs:382` | `app`: simdgroup functions on a device whose subgroups cannot run 32 wide for the use | | `LocalSize` | A local size beyond a device limit on this axis (`None` | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan/src/bind/dispatch.rs:475` | `app`: a threadgroup size past a smaller device's limit | | `IrreducibleConvergent` | An irreducible region containing a convergent instruction | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan/src/structurize/irreducible.rs:108` | `rare`: irreducible loops around barriers or simd operations | -| `ComputeDerivativesWithSimd` | Compute derivatives in a flattened simd tier | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan/src/lower/dispatch.rs:472` | `rare`: derivatives in a kernel | +| `ComputeDerivativesWithSimd` | Compute derivatives in a flattened simd tier | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan/src/lower/dispatch.rs:476` | `rare`: derivatives in a kernel | | `ComputeDerivatives` | Derivatives outside fragment without compute-derivative support | devices without VkFeature::ComputeDerivativeGroupLinear; every device (no Vulkan mechanism); every device (not implemented) | 4: `crates/metal2vulkan/src/bind/dispatch.rs:320`, `crates/metal2vulkan/src/lower/sync/barrier.rs:486` (+2) | `rare`: derivatives in a kernel | | `QuadOperations` | Quad operations in a stage without quad support | devices without VkLimit::MinSubgroupSize; devices without VkProperty::SubgroupQuadOperationsInAllStages | 2: `crates/metal2vulkan/src/device/subgroup.rs:371`, `crates/metal2vulkan/src/device/subgroup.rs:405` | `app`: quad shuffles in kernels on devices without quad operations there | | `SimdgroupMatrix` | Simdgroup matrix operations | every device (not implemented) | 1: `crates/metal2vulkan/src/lower/simd/matrix.rs:83` | `rare`: simdgroup matrix kernels | @@ -64,8 +64,8 @@ Generated at `545ff3a77`. | `CoherentMemory` | `coherent(device)` accesses (Vulkan memory model) | devices short of a Vulkan feature the site names | 1: `crates/metal2vulkan/src/lower/sync/memory_model.rs:207` | `rare`: coherent(device) accesses | | `Int64Atomics` | 64-bit atomics | devices short of a Vulkan feature the site names; devices without buffer device addresses (`addressed_needs`) | 2: `crates/metal2vulkan/src/lower/access/atomic.rs:624`, `crates/metal2vulkan/src/lower/access/atomic.rs:633` | `rare`: 64-bit atomics | | `ImageAtomics` | Image atomics beyond 32-bit integers | devices without a capability the site computes (`gaps`); every device (no Vulkan mechanism) | 3: `crates/metal2vulkan-runtime/src/families/formats.rs:464`, `crates/metal2vulkan-runtime/src/families/formats.rs:468` (+1) | `rare`: texture atomics beyond 32-bit integers | -| `DescriptorCount` | Too many descriptors of one kind in a stage or pipeline | devices short of a device limit the site names; devices without VkLimit::MaxUniformBufferRange | 3: `crates/metal2vulkan/src/lower/access/mod.rs:1684`, `crates/metal2vulkan/src/lower/select.rs:1641` (+1) | `app`: many textures or buffers in one stage on a smaller device | -| `BufferRange` | A buffer window beyond the descriptor range limits | devices without a capability the site computes (`needs`); devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism) | 7: `crates/metal2vulkan-runtime/src/function_table.rs:569`, `crates/metal2vulkan/src/bind/graphics.rs:3658` (+5) | `app`: a buffer window past a device's descriptor range | +| `DescriptorCount` | Too many descriptors of one kind in a stage or pipeline | devices short of a device limit the site names; devices without VkLimit::MaxUniformBufferRange | 3: `crates/metal2vulkan/src/lower/access/mod.rs:1688`, `crates/metal2vulkan/src/lower/select.rs:1641` (+1) | `app`: many textures or buffers in one stage on a smaller device | +| `BufferRange` | A buffer window beyond the descriptor range limits | devices without a capability the site computes (`needs`); devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism) | 7: `crates/metal2vulkan-runtime/src/function_table.rs:569`, `crates/metal2vulkan/src/bind/graphics.rs:3772` (+5) | `app`: a buffer window past a device's descriptor range | | `Int64Arithmetic` | 64-bit integer arithmetic | devices without VkFeature::ShaderInt64 | 2: `crates/metal2vulkan/src/lower/arith/legal.rs:582`, `crates/metal2vulkan/src/lower/select.rs:1133` | `rare`: 64-bit integers on a device without shaderInt64 | | `Float64Arithmetic` | 64-bit float arithmetic | devices without VkFeature::ShaderFloat64 | 2: `crates/metal2vulkan/src/device/metal.rs:230`, `crates/metal2vulkan/src/lower/arith/legal.rs:587` | `rare`: doubles (MSL has none outside Apple's own code) | | `Format` | A pixel format not supported for the required use | devices without VkFeature::ShaderStorageImageExtendedFormats; devices without a capability the site computes; devices without a capability the site computes (`alternatives`); devices without a capability the site computes (`c`); devices without a capability the site computes (`missing`); devices without a capability the site computes (`routes`); devices without a format's usage; every device (no Vulkan mechanism); every device (not implemented) | 121: `crates/metal2vulkan-runtime/src/binding_view.rs:146`, `crates/metal2vulkan-runtime/src/blit_plan.rs:523` (+119) | `system`: pixel formats a device lacks for a use (CoreVideo's 4:2:x and 10-bit formats among them) | @@ -82,31 +82,31 @@ Generated at `545ff3a77`. | `SamplerLodBias` | Sampler LOD bias | devices short of a Vulkan feature the site names; devices without VkLimit::MaxSamplerLodBias; every device (no Vulkan mechanism) | 3: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:258`, `crates/metal2vulkan/src/lower/sampler/constexpr.rs:265` (+1) | `app`: constexpr samplers with an LOD bias | | `SamplerCompare` | Sampler compare functions outside what Vulkan allows for the image | devices short of a Vulkan feature the site names | 1: `crates/metal2vulkan/src/metal/sampler.rs:260` | `app`: compare samplers a device cannot apply to the image | | `PixelSamplerCompare` | A constexpr sampler with pixel coordinates and a compare function, which Apple's compiler rejects ("invalid values combination in sampler... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:115` | `none`: Apple's compiler rejects it | -| `TexelBuffer` | Texture buffers beyond the device's texel-buffer limits | devices without a format's usage; every device (no Vulkan mechanism) | 3: `crates/metal2vulkan/src/bind/instantiate.rs:880`, `crates/metal2vulkan/src/bind/instantiate.rs:886` (+1) | `app`: texture buffers past a device's texel-buffer limits | +| `TexelBuffer` | Texture buffers beyond the device's texel-buffer limits | devices without a format's usage; every device (no Vulkan mechanism) | 3: `crates/metal2vulkan/src/bind/instantiate.rs:882`, `crates/metal2vulkan/src/bind/instantiate.rs:888` (+1) | `app`: texture buffers past a device's texel-buffer limits | | `RasterOrderGroups` | Raster order groups without fragment shader interlock | devices without VkFeature::FragmentShaderPixelInterlock; devices without VkFeature::FragmentShaderSampleInterlock; devices without a capability the site computes (`alternatives`); every device (not implemented) | 4: `crates/metal2vulkan/src/device/metal.rs:242`, `crates/metal2vulkan/src/lower/fragment/rog.rs:151` (+2) | `rare`: raster order groups | -| `FramebufferFetch` | Framebuffer fetch without an ordered form on the device (rasterization-order attachment access, or the pixel interlock's storage form where the... | devices short of a Vulkan property the site names; devices without VkFeature::FragmentShaderPixelInterlock; devices without VkFeature::RasterizationOrderColorAttachmentAccess; devices without VkFeature::SampleRateShading; devices without a capability the site computes; devices without a capability the site computes (`alternatives`); devices without a capability the site computes (`c`); devices without a capability the site computes (`capability`); devices without a capability the site computes (`missing`); devices without a format's usage; drivers with a defect; every device (not implemented) | 23: `crates/metal2vulkan-runtime/src/families/features.rs:1018`, `crates/metal2vulkan-runtime/src/render.rs:5894` (+21) | `system`: programmable blending (framebuffer fetch); macOS 26.6.2's login reaches it (two WindowServer and RenderBox pipelines fetch RGB10A8_2P_XR10 attachments, the consumer's boots) | +| `FramebufferFetch` | Framebuffer fetch without an ordered form on the device (rasterization-order attachment access, or the pixel interlock's storage form where the... | devices short of a Vulkan property the site names; devices without VkFeature::FragmentShaderPixelInterlock; devices without VkFeature::RasterizationOrderColorAttachmentAccess; devices without VkFeature::SampleRateShading; devices without a capability the site computes; devices without a capability the site computes (`alternatives`); devices without a capability the site computes (`c`); devices without a capability the site computes (`capability`); devices without a capability the site computes (`missing`); devices without a format's usage; drivers with a defect; every device (not implemented) | 23: `crates/metal2vulkan-runtime/src/families/features.rs:1018`, `crates/metal2vulkan-runtime/src/render.rs:5897` (+21) | `system`: programmable blending (framebuffer fetch); macOS 26.6.2's login reaches it (two WindowServer and RenderBox pipelines fetch RGB10A8_2P_XR10 attachments, the consumer's boots) | | `PrimitiveId` | `[[primitive_id]]` in a fragment function | devices without a capability the site computes; every device (not implemented) | 3: `crates/metal2vulkan-runtime/src/families/features.rs:1127`, `crates/metal2vulkan/src/lower/stage_io/plan.rs:3211` (+1) | `rare`: primitive_id on a device without geometry or tessellation shaders, in an indexed draw or behind a mesh function | | `PrivatePrimitives` | One of Metal's private primitive types (a line loop, a triangle fan, quads, a quad strip) drawn in the pulled list form... | - | via a helper: 1: `crates/metal2vulkan/src/lower/stage_io/plan.rs:2601` | `rare`: a private primitive type drawn in the pulled list form (a vertex function that writes memory or the primitive_id varying, a vertex start past 2^31) on a device without device addresses | -| `VertexAmplification` | Vertex amplification | devices without VkFeature::Multiview; devices without VkFeature::MultiviewTessellationShader; devices without VkLimit::MaxMultiviewInstanceIndex; devices without a capability the site computes (`needs`); every device (not implemented) | 5: `crates/metal2vulkan/src/bind/graphics.rs:3999`, `crates/metal2vulkan/src/lower/stage_io/plan.rs:1312` (+3) | `rare`: vertex amplification | +| `VertexAmplification` | Vertex amplification | devices without VkFeature::Multiview; devices without VkFeature::MultiviewTessellationShader; devices without VkLimit::MaxMultiviewInstanceIndex; devices without a capability the site computes (`needs`); every device (not implemented) | 5: `crates/metal2vulkan/src/bind/graphics.rs:4113`, `crates/metal2vulkan/src/lower/stage_io/plan.rs:1312` (+3) | `rare`: vertex amplification | | `LayeredRendering` | Layered rendering (`render_target_array_index`, `viewport_array_index`) | devices without VkFeature::ImageView2DOn3DImage; devices without VkFeature::MultiViewport; devices without VkFeature::ShaderOutputLayer; devices without VkFeature::ShaderOutputViewportIndex; devices without a capability the site computes (`needs`); every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/render_pass.rs:1669`, `crates/metal2vulkan-runtime/src/render_state.rs:1107` (+5) | `rare`: layered rendering on a device without its features | -| `ClipDistance` | Clip or cull distances | devices without VkFeature::ShaderClipDistance; devices without VkLimit::MaxClipDistances | 2: `crates/metal2vulkan/src/lower/mesh/mod.rs:941`, `crates/metal2vulkan/src/lower/mesh/mod.rs:949` | `rare`: clip distances on a device without them | +| `ClipDistance` | Clip or cull distances | devices without VkFeature::ShaderClipDistance; devices without VkLimit::MaxClipDistances | 2: `crates/metal2vulkan/src/lower/mesh/mod.rs:956`, `crates/metal2vulkan/src/lower/mesh/mod.rs:964` | `rare`: clip distances on a device without them | | `DualSourceBlending` | Dual-source blending | devices without VkFeature::DualSrcBlend; devices without VkLimit::MaxFragmentDualSrcAttachments | 5: `crates/metal2vulkan-runtime/src/families/formats.rs:386`, `crates/metal2vulkan/src/metal/state.rs:37` (+3) | `rare`: dual-source blending on a device without it | | `Barycentrics` | Barycentric coordinates | devices without VkFeature::FragmentShaderBarycentric; devices without VkFeature::GeometryShader; devices without a capability the site computes (`needs`); drivers with a defect; every device (not implemented) | 5: `crates/metal2vulkan/src/device/metal.rs:263`, `crates/metal2vulkan/src/lower/stage_io/plan.rs:1924` (+3) | `rare`: barycentric coordinates | -| `StencilExport` | Stencil export | devices without VkExtension::ExtShaderStencilExport; every device (not implemented) | 6: `crates/metal2vulkan-runtime/src/families/features.rs:1114`, `crates/metal2vulkan/src/bind/graphics.rs:2685` (+4) | `rare`: stencil from the shader | +| `StencilExport` | Stencil export | devices without VkExtension::ExtShaderStencilExport; every device (not implemented) | 6: `crates/metal2vulkan-runtime/src/families/features.rs:1114`, `crates/metal2vulkan/src/bind/graphics.rs:2719` (+4) | `rare`: stencil from the shader | | `SampleRateShading` | Per-sample shading | devices without VkFeature::SampleRateShading; devices without a capability the site computes (`needs`); every device (not implemented) | 3: `crates/metal2vulkan/src/pipeline/link/graphics.rs:844`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:846` (+1) | `rare`: per-sample shading | | `PixelCoverageAtSampleRate` | The pixel's coverage (`[[sample_mask]]` read) in a fragment function that runs once per sample | drivers with a defect; every device (no Vulkan mechanism); every device (not implemented) | 3: `crates/metal2vulkan/src/lower/fragment/coverage.rs:296`, `crates/metal2vulkan/src/lower/simd/mod.rs:754` (+1) | `rare`: coverage read at sample rate | | `InterfaceComponents` | Too many interface components or locations | devices short of a device limit the site names; devices without VkLimit::MaxColorAttachments; devices without VkLimit::MaxVertexInputAttributes | 4: `crates/metal2vulkan/src/pipeline/compile/color_group.rs:202`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:301` (+2) | `rare`: too many varyings or attachments for a device | | `UnmatchedVarying` | A fragment input without a vertex producer (a Metal link error) | every device (no Vulkan mechanism) | 3: `crates/metal2vulkan/src/pipeline/link/varyings.rs:318`, `crates/metal2vulkan/src/pipeline/link/varyings.rs:537` (+1) | `none`: a Metal link error | | `KernelStageIn` | Kernel `[[stage_in]]` | every device (not implemented) | 3: `crates/metal2vulkan-runtime/src/indirect_execute.rs:376`, `crates/metal2vulkan/src/bind/dispatch.rs:871` (+1) | `rare`: kernel stage-in combinations Metal leaves unestablished | | `Tessellation` | Tessellation | devices without VkLimit::MaxPushConstantsSize; devices without VkLimit::MaxStorageBufferRange; devices without VkLimit::MaxTessellationGenerationLevel; every device (not implemented) | 13: `crates/metal2vulkan-air/src/canon/mod.rs:1256`, `crates/metal2vulkan-air/src/canon/mod.rs:1347` (+11) | `rare`: tessellation | -| `MeshShading` | | devices short of a device limit the site names; devices without VkLimit::MaxMeshOutputLayers; devices without VkLimit::MaxTaskPayloadSize; devices without a capability the site computes (`missing`); every device (not implemented) | 7: `crates/metal2vulkan/src/bind/graphics.rs:1604`, `crates/metal2vulkan/src/bind/graphics.rs:3058` (+5) | `rare`: mesh pipelines | +| `MeshShading` | | devices short of a device limit the site names; devices without VkLimit::MaxMeshOutputLayers; devices without VkLimit::MaxTaskPayloadSize; devices without a capability the site computes (`missing`); every device (not implemented) | 7: `crates/metal2vulkan/src/bind/graphics.rs:1630`, `crates/metal2vulkan/src/bind/graphics.rs:3095` (+5) | `rare`: mesh pipelines | | `TileShading` | | devices without VkLimit::MaxStorageBufferRange; devices without a format's usage; every device (not implemented) | 5: `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:520`, `crates/metal2vulkan/src/bind/plan/compute.rs:237` (+3) | `rare`: tile shaders (Apple GPU families) | | `Imageblocks` | An imageblock outside the forms implemented | devices without VkFeature::SampleRateShading; devices without a capability the site computes (`missing`); drivers with a defect; every device (not implemented) | 10: `crates/metal2vulkan/src/lower/access/imageblock.rs:98`, `crates/metal2vulkan/src/lower/access/mod.rs:908` (+8) | `rare`: imageblocks (Apple GPU families) | | `RayTracing` | | devices without a capability the site computes (`missing`); every device (no Vulkan mechanism); every device (not implemented) | 12: `crates/metal2vulkan/src/bind/acceleration.rs:202`, `crates/metal2vulkan/src/bind/acceleration.rs:216` (+10) | `rare`: ray tracing (out of scope by ruling) | | `Tensors` | | every device (not implemented) | 2: `crates/metal2vulkan-air/src/canon/matmul2d/synth.rs:32`, `crates/metal2vulkan/src/lower/select.rs:903` | `rare`: shader tensors | | `RasterizationRateMap` | | every device (not implemented) | 1: `crates/metal2vulkan/src/lower/fragment/mod.rs:930` | `rare`: rasterization rate maps | | `GpuEncodedIndirectCommands` | | devices short of a Vulkan feature the site names; devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism); every device (not implemented) | 17: `crates/metal2vulkan/src/bind/replay.rs:556`, `crates/metal2vulkan/src/bind/replay.rs:796` (+15) | `rare`: indirect command buffers encoded by a kernel | -| `VulkanVersion` | The device's Vulkan version is below the 1.2 floor | devices without ApiVersion::V1_2 | 2: `crates/metal2vulkan/src/ash_interop/query.rs:926`, `crates/metal2vulkan/src/device/derive.rs:105` | `none`: a device below Vulkan 1.2 | +| `VulkanVersion` | The device's Vulkan version is below the 1.2 floor | devices without ApiVersion::V1_2 | 2: `crates/metal2vulkan/src/ash_interop/query.rs:927`, `crates/metal2vulkan/src/device/derive.rs:105` | `none`: a device below Vulkan 1.2 | | `Constant` | A bitcode constant record outside the typed model (block address, inline asm, `select` and other constant expressions the IR has no form for) | - | via a helper: 3: `crates/metal2vulkan-air/src/bitcode/constants.rs:210`, `crates/metal2vulkan-air/src/bitcode/constants.rs:268` (+1) | `none`: LLVM constant forms AIR does not emit | | `Attribute` | An LLVM attribute kind that changes the calling ABI and that AIR does not use (`inalloca`, `preallocated`, `byref`, `nest`, the `swift*` kinds) | - | via a helper: 2: `crates/metal2vulkan-air/src/bitcode/attrs.rs:493`, `crates/metal2vulkan/src/error/mod.rs:256` | `none`: LLVM ABI attributes AIR does not use | | `BitcodeRecord` | A bitcode record LLVM defines in `block` that the typed model does not cover and that has no more specific variant (legacy spellings predating... | - | via a helper: 7: `crates/metal2vulkan-air/src/bitcode/attrs.rs:337`, `crates/metal2vulkan-air/src/bitcode/function.rs:572` (+5) | `none`: bitcode records AIR does not emit | @@ -122,7 +122,7 @@ Generated at `545ff3a77`. | `SamplerBicubicFilter` | A use of Metal's bicubic filter that no Metal reading establishes | every device (not implemented) | 5: `crates/metal2vulkan/src/bind/heap.rs:997`, `crates/metal2vulkan/src/bind/plan/resources.rs:1876` (+3) | `system`: bicubic filtering forms Metal does not establish; macOS 26.6.2 makes a runtime sampler with MTLSamplerMinMagFilterCubic (the consumer's boots), whose mip-filtered form is refused | | `GroupCount` | A dispatch whose threadgroup count on `axis` exceeds `maxComputeWorkGroupCount` by more than the binder splits into regions (`None` | every device (no Vulkan mechanism) | 5: `crates/metal2vulkan/src/bind/dispatch.rs:379`, `crates/metal2vulkan/src/bind/dispatch.rs:455` (+3) | `rare`: more threadgroups than a device dispatches, past the binder's split | | `IntersectionFunctionTable` | A ray intersection through intersection functions | every device (no Vulkan mechanism); every device (not implemented) | 9: `crates/metal2vulkan/src/bind/acceleration.rs:177`, `crates/metal2vulkan/src/bind/acceleration.rs:183` (+7) | `rare`: ray tracing (out of scope by ruling) | -| `IndependentBlending` | Color attachments whose write masks or blend states differ, as Metal sets them per attachment, on a device without `independentBlend`, where no... | devices without VkFeature::IndependentBlend | 2: `crates/metal2vulkan-runtime/src/render.rs:2173`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:1017` | `rare`: per-attachment blending on a device without independentBlend | +| `IndependentBlending` | Color attachments whose write masks or blend states differ, as Metal sets them per attachment, on a device without `independentBlend`, where no... | devices without VkFeature::IndependentBlend | 2: `crates/metal2vulkan-runtime/src/render.rs:2176`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:1017` | `rare`: per-attachment blending on a device without independentBlend | | `RasterSampleCount` | A `rasterSampleCount` outside the device's framebuffer sample counts for the pipeline's attachments (`framebuffer*SampleCounts`), and, for a color... | devices short of a Vulkan property the site names; devices without a capability the site computes | 2: `crates/metal2vulkan-runtime/src/families/limits.rs:1063`, `crates/metal2vulkan/src/pipeline/graphics.rs:563` | `app`: a sample count a device lacks for the attachments | | `TriangleFillLines` | The render encoder's `MTLTriangleFillModeLines` (`polygonMode` `LINE`) on a device without `fillModeNonSolid` | - | via a helper: 1: `crates/metal2vulkan/src/metal/state.rs:347` | `app`: wireframe on a device without fillModeNonSolid | | `DepthClipClamp` | The render encoder's `MTLDepthClipModeClamp` (`depthClampEnable`) on a device without `depthClamp` | - | via a helper: 1: `crates/metal2vulkan/src/metal/state.rs:363` | `app`: depth clamp on a device without depthClamp | @@ -131,13 +131,13 @@ Generated at `545ff3a77`. | `SparseTexture` | A sparse texture (`MTLTexture.isSparse`) bound at `slot`, where a function observes the residency of its accesses (`sparse_color::resident()`) and... | - | via a helper: 2: `crates/metal2vulkan/src/bind/plan/slots.rs:583`, `crates/metal2vulkan/src/bind/plan/slots.rs:607` | `rare`: sparse residency reads | | `TextureSize` | A texture whose extent, array layers, or level count is past what the device takes for its format, type, and usage (`Capability::Limit` names the... | devices short of a device limit the site names | 1: `crates/metal2vulkan-runtime/src/image_plan.rs:1196` | `app`: a texture past a device's image limits | | `TextureSampleCount` | A texture sample count the device does not take for its format, type, and usage | devices short of a Vulkan property the site names; devices without VkFeature::MultisampleArrayImage; every device (no Vulkan mechanism) | 3: `crates/metal2vulkan-runtime/src/image_plan.rs:1244`, `crates/metal2vulkan-runtime/src/image_plan.rs:598` (+1) | `app`: a sample count a device lacks for the texture | -| `TextureView` | A texture view Vulkan cannot make exactly on this image | every device (no Vulkan mechanism); every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/binding_view.rs:156`, `crates/metal2vulkan-runtime/src/texture.rs:5136` (+5) | `app`: a texture view Vulkan cannot make exactly | -| `TextureSwizzle` | A texture swizzle whose Metal behavior is not measured | devices short of a Vulkan feature the site names; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/binding_view.rs:167`, `crates/metal2vulkan-runtime/src/texture.rs:996` (+5) | `app`: texture swizzles whose Metal behaviour is unmeasured | +| `TextureView` | A texture view Vulkan cannot make exactly on this image | every device (no Vulkan mechanism); every device (not implemented) | 8: `crates/metal2vulkan-runtime/src/binding_view.rs:156`, `crates/metal2vulkan-runtime/src/texture.rs:5150` (+6) | `app`: a texture view Vulkan cannot make exactly | +| `TextureSwizzle` | A texture swizzle whose Metal behavior is not measured | devices short of a Vulkan feature the site names; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/binding_view.rs:167`, `crates/metal2vulkan-runtime/src/texture.rs:998` (+5) | `app`: texture swizzles whose Metal behaviour is unmeasured | | `MipmapGeneration` | `generateMipmapsForTexture:` where the device's filter is not shown to give Metal's answer | devices without VkFeature::ShaderInt64; devices without a format's usage; every device (not implemented) | 7: `crates/metal2vulkan-runtime/src/blit_texture.rs:1890`, `crates/metal2vulkan-runtime/src/mipmap_pick.rs:37` (+5) | `app`: generateMipmapsForTexture: where the device's filter is not Metal's | | `HostMemory` | A buffer over the caller's host memory without a copy (`newBufferWithBytesNoCopy:`) | devices without VkExtension::ExtExternalMemoryHost; every device (no Vulkan mechanism); every device (not implemented) | 5: `crates/metal2vulkan-runtime/src/host_memory.rs:430`, `crates/metal2vulkan-runtime/src/host_memory.rs:470` (+3) | `system`: newBufferWithBytesNoCopy: where the device cannot import the memory | -| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2814` | `rare`: GPU times on a queue without timestamps | +| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2876` | `rare`: GPU times on a queue without timestamps | | `CountingVisibility` | A `Counting` visibility result (`MTLVisibilityResultModeCounting`) on a device without `occlusionQueryPrecise` | devices without VkFeature::OcclusionQueryPrecise | 1: `crates/metal2vulkan-runtime/src/visibility.rs:452` | `rare`: counting occlusion queries on a device without precise queries | -| `ViewFormatReinterpretation` | A texture view whose format has other components, or components of other widths, than its texture's (`RGBA8Unorm` as `R32Uint`), on a device whose... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/view_plan.rs:570` | `app`: a view of another component layout on a portability subset (MoltenVK) | +| `ViewFormatReinterpretation` | A texture view whose format has other components, or components of other widths, than its texture's (`RGBA8Unorm` as `R32Uint`), on a device whose... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/view_plan.rs:573` | `app`: a view of another component layout on a portability subset (MoltenVK) | | `SeparateMultisampledDepthStencil` | A render pass whose depth and stencil attachments are separate multisampled textures that it loads or may store, on a device without maintenance8,... | - | via a helper: 7: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:188`, `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:294` (+5) | `rare`: separate multisampled depth and stencil textures | | `PixelCoverage` | The fragment's coverage (`[[sample_mask]]` read) in a fragment function of a pipeline of more than one sample that runs once per pixel | drivers with a defect | 2: `crates/metal2vulkan-runtime/src/families/features.rs:1225`, `crates/metal2vulkan/src/pipeline/link/graphics.rs:783` | `rare`: coverage reads at pixel rate in a multisampled pipeline | | `CentroidVarying` | A centroid varying (`[[centroid_perspective]]`, `[[centroid_no_perspective]]`) in a fragment function of a pipeline of more than one sample | drivers with a defect | 1: `crates/metal2vulkan/src/pipeline/link/graphics.rs:801` | `rare`: centroid varyings in a multisampled pipeline | @@ -146,7 +146,7 @@ Generated at `545ff3a77`. | `SparseMapping` | A sparse texture's mapping update (`updateTextureMapping:` and its array form, or a move of mappings) that covers part of one of the device's... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/sparse/encoder.rs:473` | `rare`: sparse mappings off the device's blocks | | `TimelineSemaphores` | Command buffers and events, which the runtime completes and signals through timeline semaphores (core in Vulkan 1.2), on a device whose... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/device/create.rs:1115` | `none`: a device below the runtime's floor | | `Reflection` | Reflection of an argument whose answer Metal's has not been measured for (`reflection`) | every device (not implemented) | 9: `crates/metal2vulkan/src/bind/argument_buffer.rs:626`, `crates/metal2vulkan/src/reflection/derive.rs:178` (+7) | `rare`: reflection of argument kinds Metal's answer is unmeasured for | -| `HeapTextureTiling` | A texture of a heap whose memory the device's optimal images do not take (a `Shared` heap on a device whose optimal images take no host-visible... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/texture/heap.rs:630` | `app`: textures in Shared heaps on a device whose optimal images take no host memory | +| `HeapTextureTiling` | A texture of a heap whose memory the device's optimal images do not take (a `Shared` heap on a device whose optimal images take no host-visible... | every device (no Vulkan mechanism) | 1: `crates/metal2vulkan-runtime/src/texture/heap.rs:632` | `app`: textures in Shared heaps on a device whose optimal images take no host memory | | `ViewportDepthRange` | A viewport depth range past `[0, 1]` (`setViewport:`), which Metal takes and the runtime draws natively (`VK_EXT_depth_range_unrestricted`) or... | drivers with a defect | 1: `crates/metal2vulkan-runtime/src/render_state.rs:1216` | `rare`: viewport depth outside [0, 1] | | `UndeclaredTextureUsage` | A shader write to a texture made without `ShaderWrite` (or `ShaderAtomic`), or a read of one made without `ShaderRead`, which plain Metal runs,... | every device (not implemented) | 2: `crates/metal2vulkan-runtime/src/binding_view.rs:141`, `crates/metal2vulkan-runtime/src/texture/usage_shadow.rs:72` | `app`: a shader write to a texture made without ShaderWrite, which plain Metal runs | | `RenderTargetSize` | A render pass whose render area or layers are past the device's framebuffer limits (`Capability::Limit` names `MaxFramebufferWidth`,... | devices short of a device limit the site names | 1: `crates/metal2vulkan-runtime/src/render_pass.rs:1271` | `rare`: a render area past a device's framebuffer limits | @@ -165,20 +165,20 @@ Generated at `545ff3a77`. |---|---|---|---|---| | `Textures` | Textures and texture buffers | every device (runtime piece not built) | 9: `crates/metal2vulkan-runtime/src/blit_texture.rs:163`, `crates/metal2vulkan-runtime/src/buffer_texture.rs:1563` (+7) | `rare`: texture forms the runtime has not built (texture buffers of some forms, X24Stencil8 views) | | `ResourceHeap` | The resource-ID heap, descriptor set 1 | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/binding.rs:1982` | `rare`: the resource-ID heap's remaining forms | -| `SparseHeaps` | Sparse heaps and their textures | every device (runtime piece not built) | 3: `crates/metal2vulkan-runtime/src/sparse/encoder.rs:465`, `crates/metal2vulkan-runtime/src/texture.rs:1674` (+1) | `rare`: sparse heaps | +| `SparseHeaps` | Sparse heaps and their textures | every device (runtime piece not built) | 3: `crates/metal2vulkan-runtime/src/sparse/encoder.rs:465`, `crates/metal2vulkan-runtime/src/texture.rs:1683` (+1) | `rare`: sparse heaps | | `SparseTileMaps` | What the runtime's emulation of sparse textures does not build yet | every device (runtime piece not built) | 3: `crates/metal2vulkan-runtime/src/binding.rs:562`, `crates/metal2vulkan-runtime/src/sparse/texture.rs:30` (+1) | `rare`: sparse texture emulation's unbuilt pieces | | `HeapPastMaxBufferSize` | A heap larger than the device's `maxBufferSize`, which the device can allocate | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/heap.rs:714` | `rare`: a heap past maxBufferSize | -| `HeapTextureAlignment` | A heap texture whose image needs an alignment past the heap memory's base alignment (256 KiB) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture/heap.rs:1071` | `rare`: a heap texture needing more than 256 KiB alignment | -| `HeapTextureMemory` | A heap texture whose image the heap's memory type does not take | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/texture/heap.rs:1510`, `crates/metal2vulkan-runtime/src/texture/heap.rs:1517` (+3) | `app`: a heap texture the heap's memory type does not take | +| `HeapTextureAlignment` | A heap texture whose image needs an alignment past the heap memory's base alignment (256 KiB) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture/heap.rs:1073` | `rare`: a heap texture needing more than 256 KiB alignment | +| `HeapTextureMemory` | A heap texture whose image the heap's memory type does not take | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/texture/heap.rs:1512`, `crates/metal2vulkan-runtime/src/texture/heap.rs:1519` (+3) | `app`: a heap texture the heap's memory type does not take | | `FunctionTablePastMaxBufferLength` | A visible-function table of more entries than one buffer of the device's `max_buffer_length` holds words for, or than its size word holds | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/function_table.rs:622` | `none`: a function table past one buffer | -| `IndirectCommandBufferPastMaxBufferLength` | An indirect command buffer of more commands than one buffer of the device's `max_buffer_length` holds the records of | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:522` | `none`: an ICB past one buffer | +| `IndirectCommandBufferPastMaxBufferLength` | An indirect command buffer of more commands than one buffer of the device's `max_buffer_length` holds the records of | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:523` | `none`: an ICB past one buffer | | `IndirectRenderCommands` | What indirect command buffers lack of their render commands | every device (runtime piece not built) | 15: `crates/metal2vulkan-runtime/src/compute.rs:1291`, `crates/metal2vulkan-runtime/src/compute.rs:1376` (+13) | `rare`: indirect render commands' remaining pieces | -| `IndirectImageblockSize` | An indirect compute command's imageblock side past 65535, which Metal keeps | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3363` | `none`: an imageblock side past 65535 | +| `IndirectImageblockSize` | An indirect compute command's imageblock side past 65535, which Metal keeps | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3397` | `none`: an imageblock side past 65535 | | `CommandReplay` | The device replay of indirect command buffers | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/binding.rs:723`, `crates/metal2vulkan-runtime/src/binding.rs:726` | `rare`: the device replay of indirect command buffers | | `RenderAttachments` | Render attachments and their binding forms | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/binding.rs:1794` | `rare`: render attachment forms not built | | `AccelerationStructures` | Acceleration structures | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/binding.rs:1797` | `rare`: ray tracing (out of scope by ruling) | -| `FeatureEnable` | A feature a created device would enable that the runtime's feature chain has no member for, or whose structure no enabled extension exposes | devices without the feature or extension it names | 1: `crates/metal2vulkan-runtime/src/enables.rs:1165` | `none`: device creation with a feature the runtime's chain lacks | -| `ExtensionEnable` | An extension a created device would enable that the device lists under none of the names the runtime knows for it | devices without the feature or extension it names | 1: `crates/metal2vulkan-runtime/src/enables.rs:1156` | `none`: device creation with an extension under an unknown name | +| `FeatureEnable` | A feature a created device would enable that the runtime's feature chain has no member for, or whose structure no enabled extension exposes | devices without the feature or extension it names | 1: `crates/metal2vulkan-runtime/src/enables.rs:1166` | `none`: device creation with a feature the runtime's chain lacks | +| `ExtensionEnable` | An extension a created device would enable that the device lists under none of the names the runtime knows for it | devices without the feature or extension it names | 1: `crates/metal2vulkan-runtime/src/enables.rs:1157` | `none`: device creation with an extension under an unknown name | | `Render` | Render pipelines, passes and draws | every device (runtime piece not built) | 23: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:404`, `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:460` (+21) | `system`: render pass, resolve and attachment forms not built (20 sites: see the appendix) | | `TexelsPastBufferLength` | A 2D array over a buffer whose texels run past the buffer's length, which Metal makes over bytes its buffer's allocation has past the length | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/buffer_texture.rs:261`, `crates/metal2vulkan-runtime/src/texture/surface_depth.rs:105` | `rare`: a 2D array over a buffer past its length | | `OverlappingSurfaceRows` | A texture of an IOSurface plane (`Buffer::new_texture_with_iosurface_plane`, the stand-in for `newTextureWithDescriptor:iosurface:plane:`) whose... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/buffer_texture.rs:263` | `rare`: an IOSurface plane whose rows overlap | @@ -187,12 +187,12 @@ Generated at `545ff3a77`. | `ViewportDepthRange` | A viewport depth range past `[0, 1]`, which Metal takes, on a device without the features to take it natively or by the vertex stage's... | every device (runtime piece not built) | 7: `crates/metal2vulkan-runtime/src/render/draw_shape.rs:341`, `crates/metal2vulkan-runtime/src/render_state.rs:1039` (+5) | `rare`: viewport depth outside [0, 1] without the device features | | `NonFiniteDepthBias` | NaN or infinite depth bias factors whose effect differs between flat and sloped triangles, or a draw whose bias adds a clamp that moves a... | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/render_state.rs:1603`, `crates/metal2vulkan-runtime/src/render_state.rs:1606` (+3) | `rare`: NaN or infinite depth bias | | `DepthNeverWithoutAttachment` | A draw under a depth compare of `Never` in a pass without a depth attachment, which fails every fragment, whose fragment function writes color... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/depth_stencil.rs:147` | `rare`: depth compare Never with no depth attachment | -| `HiddenDepthStencil` | A draw whose depth/stencil state uses depth or the stencil that the pass lacks, which plain Metal tests against a hidden `float` depth of 1.0 and... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:563`, `crates/metal2vulkan-runtime/src/render.rs:6617` | `app`: a depth-stencil state using depth or stencil the pass lacks | -| `IndirectDrawArguments` | An indirect draw whose arguments the binding plan asks to read on the CPU (`DrawCommands::indirect_needs_arguments`) | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/index_bounds.rs:91`, `crates/metal2vulkan-runtime/src/render.rs:3302` (+3) | `rare`: indirect draws whose arguments the CPU must read | +| `HiddenDepthStencil` | A draw whose depth/stencil state uses depth or the stencil that the pass lacks, which plain Metal tests against a hidden `float` depth of 1.0 and... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:563`, `crates/metal2vulkan-runtime/src/render.rs:6620` | `app`: a depth-stencil state using depth or stencil the pass lacks | +| `IndirectDrawArguments` | An indirect draw whose arguments the binding plan asks to read on the CPU (`DrawCommands::indirect_needs_arguments`) | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/index_bounds.rs:91`, `crates/metal2vulkan-runtime/src/render.rs:3305` (+3) | `rare`: indirect draws whose arguments the CPU must read | | `DepthStencilResolve` | A depth/stencil resolve no Vulkan resolve mode of the device states | every device (runtime piece not built) | 7: `crates/metal2vulkan-runtime/src/depth_stencil_resolve.rs:441`, `crates/metal2vulkan-runtime/src/resolve.rs:1388` (+5) | `rare`: depth/stencil resolve modes a device lacks | | `TileAtSampleCount` | The tile memory of a render pass of a sample count Apple's GPUs lack (theirs are 1, 2 and 4), which a Vulkan device may have | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/render_pass.rs:1611`, `crates/metal2vulkan-runtime/src/render_pass.rs:937` | `none`: tile memory at a sample count Apple's GPUs lack | -| `ImageblockMasters` | A draw or tile dispatch whose imageblock is of another size than the pass's, or a draw whose fragment function's layouts are of another alignment... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/render.rs:7350`, `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:929` | `rare`: imageblocks of mixed sizes in one pass | -| `TileAndFragmentImageblocks` | A render pass that reaches its imageblock storage, from a draw whose fragment function declares an explicit imageblock or a tile dispatch whose... | every device (runtime piece not built) | 3: `crates/metal2vulkan-runtime/src/render.rs:7342`, `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:796` (+1) | `rare`: explicit imageblocks shared by tile and fragment functions | +| `ImageblockMasters` | A draw or tile dispatch whose imageblock is of another size than the pass's, or a draw whose fragment function's layouts are of another alignment... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/render.rs:7353`, `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:929` | `rare`: imageblocks of mixed sizes in one pass | +| `TileAndFragmentImageblocks` | A render pass that reaches its imageblock storage, from a draw whose fragment function declares an explicit imageblock or a tile dispatch whose... | every device (runtime piece not built) | 3: `crates/metal2vulkan-runtime/src/render.rs:7345`, `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:796` (+1) | `rare`: explicit imageblocks shared by tile and fragment functions | | `Metal4Api` | Metal 4's API (`MTL4CommandQueue`, `MTL4CommandBuffer`, `MTL4ArgumentTable`, `MTL4Compiler` and the rest), with the features only its programming... (not scheduled) | every device (runtime piece not built) | family audit only: 3: `crates/metal2vulkan-runtime/src/families/features.rs:1487`, `crates/metal2vulkan-runtime/src/families/limits.rs:1026` (+1) | `app`: Metal 4 (the API is missing: METAL-COVERAGE.md) | | `CounterSampleBuffers` | Counter sample buffers (`MTLCounterSampleBuffer`) and the commands that sample into them (not scheduled) | every device (runtime piece not built) | family audit only: 1: `crates/metal2vulkan-runtime/src/families/limits.rs:1017` | `app`: GPU counters and timestamps by sample buffer (missing API) | | `ResidencySets` | Residency sets (`MTLResidencySet`) (not scheduled) | every device (runtime piece not built) | family audit only: 2: `crates/metal2vulkan-runtime/src/families/features.rs:1469`, `crates/metal2vulkan-runtime/src/families/limits.rs:1019` | `app`: residency sets (missing API) | @@ -204,38 +204,37 @@ Generated at `545ff3a77`. | `ShaderValidation` | Per-pipeline shader validation (`MTLShaderValidation`) (not scheduled) | every device (runtime piece not built) | family audit only: 1: `crates/metal2vulkan-runtime/src/families/features.rs:1467` | `rare`: per-pipeline shader validation | | `ShaderLogging` | Shader logging (`MTLLogState`, a shader's `os_log`) (not scheduled) | every device (runtime piece not built) | family audit only: 1: `crates/metal2vulkan-runtime/src/families/features.rs:1468` | `rare`: shader os_log | | `DeviceNotifications` | Device notifications (`MTLCopyAllDevicesWithObserver`) (not scheduled) | every device (runtime piece not built) | family audit only: 1: `crates/metal2vulkan-runtime/src/families/features.rs:1472` | `rare`: device hotplug notifications (deprecated) | -| `RateMapRegions` | A draw in a rate-mapped pass that the region path does not draw, for the compile layer's reason (`rate_mapped_pass.rs`) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/rate_mapped_pass.rs:349` | `rare`: draws in rate-mapped passes the region path does not draw | +| `RateMapRegions` | A draw in a rate-mapped pass that the region path does not draw, for the compile layer's reason (`rate_mapped_pass.rs`) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/rate_mapped_pass.rs:396` | `rare`: draws in rate-mapped passes the region path does not draw | | `LayeredPass` | A layered render pass (`renderTargetArrayLength` 2 or more) that needs a step of one layer | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/color_resolve.rs:890` | `rare`: layered passes needing a per-layer color resolve | | `FunctionOptions` | A function descriptor's options beyond `CompileToBinary` and `StoreFunctionInMetalPipelinesScript` (`Library::new_function_with_descriptor`) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/library.rs:215` | `rare`: function descriptor options beyond CompileToBinary | | `OverlappingTextureCopies` | A blit copy between overlapping regions of one texture's texels (`copyFromTexture:...` with the source's region meeting the destination's, through... (not scheduled) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/blit_texture.rs:1340` | `rare`: overlapping texture copies (Metal races) | -| `RebindTextures` | `Buffer::rebind_bytes_no_copy` of a no-copy buffer with a live texture over its bytes, given memory at another offset in its page than the old | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:637`, `crates/metal2vulkan-runtime/src/texture/heap.rs:2726` (+3) | `none`: a runtime extension's rebind with a live texture | -| `PvrtcBlockOrder` | A PVRTC texture's blocks in a Metal block order the runtime does not lay out | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture.rs:5775` | `rare`: PVRTC regions off whole levels | -| `DecodedHeapTexture` | A heap's or a sparse heap's texture of an ASTC format on a device without that ASTC format (`astc.rs`), or a sparse heap's texture of an ETC2 or... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/texture.rs:1682`, `crates/metal2vulkan-runtime/src/texture/heap.rs:1373` | `app`: an ASTC texture in a heap on a device without ASTC | +| `RebindTextures` | `Buffer::rebind_bytes_no_copy` of a no-copy buffer with a live texture over its bytes, given memory at another offset in its page than the old | every device (runtime piece not built) | 5: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:637`, `crates/metal2vulkan-runtime/src/texture/heap.rs:2743` (+3) | `none`: a runtime extension's rebind with a live texture | +| `PvrtcBlockOrder` | A PVRTC texture's blocks in a Metal block order the runtime does not lay out | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture.rs:5795` | `rare`: PVRTC regions off whole levels | +| `DecodedHeapTexture` | A heap's or a sparse heap's texture of an ASTC format on a device without that ASTC format (`astc.rs`), or a sparse heap's texture of an ETC2 or... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/texture.rs:1691`, `crates/metal2vulkan-runtime/src/texture/heap.rs:1375` | `app`: an ASTC texture in a heap on a device without ASTC | | `VertexFetchPast4GiB` | A draw (`drawPrimitives:` and its forms, or an indirect command buffer's command) that may read a vertex attribute the pipeline fetches in its... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/render/vertex_reach.rs:72` | `rare`: vertex fetch past 4 GiB of a bind offset | | `StageInFetchPast4GiB` | A dispatch (`dispatchThreads:threadsPerThreadgroup:` and its forms, or an indirect command buffer's command) whose kernel may read a... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/fetch_reach.rs:126` | `rare`: stage-in fetch past 4 GiB of a bind offset | | `MappedTextureSampling` | A command that would sample a texture of an address-mode map (`TextureDescriptor::address_mode_map`) where the runtime cannot map it at bind... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/address_map.rs:158` | `none`: a runtime extension's texture (address_mode_map) sampled where the runtime cannot map it; no Metal API path | | `LibrarySource` | A library compiled from Metal Shading Language source | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/library.rs:107` | `app`: a library compiled from Metal source (newLibraryWithSource:); the runtime takes metallibs and AIR | | `RestartedStrip` | An indexed strip after `set_primitive_restart_enabled` with an index Vulkan does not restart at, which the runtime draws as a list an index... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/render/restart.rs:71` | `none`: a strip after the Apple-private setPrimitiveRestartEnabled:index: whose rewrite pass cannot run as Metal draws | -| `PrivatePrimitives` | A draw of one of Metal's private primitive types (`DrawPrimitiveType` | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/render.rs:7937`, `crates/metal2vulkan-runtime/src/render/restart.rs:72` | `none`: a draw of an Apple-private primitive type (OpenGL on Metal's quads and kin) whose list cannot draw as Metal draws: a list past a u32 or one storage range, indices or arguments an unordered earlier draw wrote | +| `PrivatePrimitives` | A draw of one of Metal's private primitive types (`DrawPrimitiveType` | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/render.rs:8029`, `crates/metal2vulkan-runtime/src/render/restart.rs:72` | `none`: a draw of an Apple-private primitive type (OpenGL on Metal's quads and kin) whose list cannot draw as Metal draws: a list past a u32 or one storage range, indices or arguments an unordered earlier draw wrote | | `ProvokingVertex` | A draw under Apple's last provoking vertex (`setProvokingVertexMode:` 1) on a device without `VK_EXT_provoking_vertex`'s last vertex, which the... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/render/restart.rs:73` | `none`: a draw after the Apple-private setProvokingVertexMode: 1, on a device without the last provoking vertex, whose rotated list cannot draw as Metal draws | -| `PrimitiveIdIndices` | An indexed draw (`drawIndexedPrimitives:`) of a pipeline whose fragment function reads `[[primitive_id]]` on a device whose fragment stage cannot... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/render.rs:7947` | `rare`: an indexed draw of a primitive_id pipeline, on a device without geometry or tessellation shaders, whose indices the encoder wrote since its last barrier | +| `PrimitiveIdIndices` | An indexed draw (`drawIndexedPrimitives:`) of a pipeline whose fragment function reads `[[primitive_id]]` on a device whose fragment stage cannot... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/render.rs:8039` | `rare`: an indexed draw of a primitive_id pipeline, on a device without geometry or tessellation shaders, whose indices the encoder wrote since its last barrier | | `RotatedTexture` | A rotated texture (`TextureDescriptor::rotation`) where the runtime does not build what Metal does | every device (runtime piece not built) | 9: `crates/metal2vulkan-runtime/src/blit_texture.rs:1669`, `crates/metal2vulkan-runtime/src/buffer_texture.rs:715` (+7) | `rare`: a rotated drawable's views, blits with images over overlapping rows, rows past its buffer | | `DetachTextures` | A texture over a no-copy buffer's or heap's bytes (a heap's texture, or a texture over the buffer or over one of the heap's buffers) that no... | every device (runtime piece not built) | 8: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:641`, `crates/metal2vulkan-runtime/src/buffer_texture.rs:622` (+6) | `none`: a runtime extension's detach with a texture no stand-in presents exactly | | `TextureBufferLevels` | A texture buffer of more than one level (`TextureDescriptor::mipmap_level_count`, up to its width's full chain) from the device's, a heap's or the... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture_descriptor.rs:540` | `rare`: a texture buffer of more than one level (public, unusual) | | `WriteSwizzle` | A texture of `TextureDescriptor::write_swizzle_enabled` whose swizzle is not the default, with `ShaderWrite` or `RenderTarget` usage, from the... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture_descriptor.rs:547` | `none`: Apple-private writeSwizzleEnabled with a swizzle that writes | -| `DetachedTexelAccess` | `Texture::replace_region` or `get_bytes` of a texture whose bytes (a no-copy buffer's or heap's) are detached (`detach_backing`) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture.rs:4924` | `none`: CPU texel access while a runtime extension detached the bytes | +| `DetachedTexelAccess` | `Texture::replace_region` or `get_bytes` of a texture whose bytes (a no-copy buffer's or heap's) are detached (`detach_backing`) | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/texture.rs:4938` | `none`: CPU texel access while a runtime extension detached the bytes | | `SurfaceDepthStencil` | A use of a texture of a depth or stencil format (`Depth16Unorm`, `Depth32Float`, `Depth32Float_Stencil8`, `Stencil8`, `X32_Stencil8`) over a plane... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/blit_texture.rs:269`, `crates/metal2vulkan-runtime/src/texture/surface_depth.rs:57` | `rare`: a blit of the stencil of a Depth32Float_Stencil8 texture over a plane of an IOSurface with planes, or a pass on an X32_Stencil8 one's view as Depth32Float_Stencil8 | | `ExtendedRangeResolve` | The multisample resolve (`MultisampleResolve`, `StoreAndMultisampleResolve`) of a color attachment of an extended-range format (`BGRA10_XR`,... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/resolve.rs:604` | `rare`: a multisample resolve of a BGRA10_XR, BGR10_XR or sRGB twin attachment (EDR content drawn multisampled) | -| `PredicationDropsUngatedWork` | An unbalanced command-predication record (`ComputeCommandEncoder::encode_end_if` and the other ends, or `encode_start_else`, with no block open;... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/predication.rs:762` | `none`: an unbalanced Apple-private command-predication record as its unit's first, after dispatches of the unit | | `MultisampledBufferCopy` | A blit copy between a buffer and a multisampled texture (`copyFromBuffer:...toTexture:` into, or `copyFromTexture:...toBuffer:` out of, a texture... | every device (runtime piece not built) | 2: `crates/metal2vulkan-runtime/src/blit_texture.rs:536`, `crates/metal2vulkan-runtime/src/blit_texture.rs:693` | `rare`: a buffer<->multisampled-texture copy on a device without sample-rate shading, an integer multisample attachment at the count, or the copy format's storage; and, where maintenance8's depth/colour copies are missing or wrong, what the sample-rate draws cannot move: a 16-bit depth, or a depth or stencil texture they cannot sample or render to (emulated elsewhere; the consumer's Maps pans and screensaver make the copy) | -| `MultisampledBufferLayout` | A blit copy between a buffer and a multisampled texture (as for `MultisampledBufferCopy`) in one of two buffer layouts that plain Metal copies by... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/sample_interleave.rs:1020` | `rare`: a buffer<->multisampled-texture copy at a bytesPerRow of 0 from an offset that is a multiple of 16, or of pixels of 32 bytes or more at a pitch below a row or off the pixel: Metal copies these by rules not yet reduced, and its API validation rejects them | +| `MultisampledBufferLayout` | A blit copy between a buffer and a multisampled texture (as for `MultisampledBufferCopy`) in one of two buffer layouts that plain Metal copies by... | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/sample_interleave.rs:1029` | `rare`: a buffer<->multisampled-texture copy at a bytesPerRow of 0 from an offset that is a multiple of 16, or of pixels of 32 bytes or more at a pitch below a row or off the pixel: Metal copies these by rules not yet reduced, and its API validation rejects them | | `ColorAttachmentGroups` | What a render pass the device draws in color groups does not build | every device (runtime piece not built) | 1: `crates/metal2vulkan-runtime/src/render/color_groups.rs:106` | `app`: in a render pass of more color attachments than the device draws at once (five or more on a device of four), or one at an index past them: a pipeline state of other colors, a tile state, an execution of render commands, a draw reading another group's attachment | ## 3. Apple-only calls (`Error::AppleOnly`) | Variant | What it blocks | Where | Sites | Reach | |---|---|---|---|---| -| `ProtectedContent` | Protection options whose answer on Metal is not measured (`command_buffer/protection.rs`) | every device (Apple-private, Metal's answer not measured) | 3: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2372`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126` (+1) | `none`: Apple-private (no public header) | +| `ProtectedContent` | Protection options whose answer on Metal is not measured (`command_buffer/protection.rs`) | every device (Apple-private, Metal's answer not measured) | 3: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2414`, `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126` (+1) | `none`: Apple-private (no public header) | | `LineWidth` | A line width other than 1 (`setLineWidth:`) | every device (Apple-private, Metal's answer not measured) | 1: `crates/metal2vulkan-runtime/src/apple_only.rs:189` | `none`: Apple-private (no public header) | | `ViewportTransformDisabled` | The viewport transform turned off (`setViewportTransformEnabled:NO`) | every device (Apple-private, Metal's answer not measured) | 1: `crates/metal2vulkan-runtime/src/apple_only.rs:191` | `none`: Apple-private (no public header) | | `VertexAmplificationMode` | `setVertexAmplificationMode:value:` of a count (the value's set bits in mode 1, else the value) of 0, whose copies change from run to run on... | every device (Apple-private, Metal's answer not measured) | 2: `crates/metal2vulkan-runtime/src/apple_only.rs:195`, `crates/metal2vulkan-runtime/src/apple_only.rs:320` | `none`: Apple-private (no public header) | @@ -245,14 +244,14 @@ Generated at `545ff3a77`. | Variant | What it blocks | Where | Sites | Reach | |---|---|---|---|---| -| `DescriptorRangeExceeded` | A descriptor-form slot's window exceeds the descriptor range limit (Profile F) | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:653` | `app`: a buffer window past a device's descriptor range | -| `TexelBufferTooLarge` | A texel buffer exceeds `maxTexelBufferElements` | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:892` | `rare`: a texture buffer past maxTexelBufferElements | +| `DescriptorRangeExceeded` | A descriptor-form slot's window exceeds the descriptor range limit (Profile F) | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:655` | `app`: a buffer window past a device's descriptor range | +| `TexelBufferTooLarge` | A texel buffer exceeds `maxTexelBufferElements` | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:894` | `rare`: a texture buffer past maxTexelBufferElements | | `HeapTooLarge` | The set-1 heap's elements (one per resident texture a handle can name, plus the null element) exceed the pipeline's heap capacity | at the device's limit | 7: `crates/metal2vulkan/src/bind/heap.rs:1014`, `crates/metal2vulkan/src/bind/heap.rs:1748` (+5) | `rare`: more resident textures than the pipeline's heap holds (bindless at scale) | -| `TessellationFactorRange` | The tessellation factors a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`),... | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3653` | `rare`: tessellation factors past one storage descriptor | -| `PatchIndexRange` | The patch indices a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`) | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3697` | `rare`: patch indices past one storage descriptor | -| `ControlPointIndexRange` | The control-point indices a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`) | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3735` | `rare`: control-point indices past one storage descriptor | +| `TessellationFactorRange` | The tessellation factors a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`),... | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3767` | `rare`: tessellation factors past one storage descriptor | +| `PatchIndexRange` | The patch indices a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`) | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3811` | `rare`: patch indices past one storage descriptor | +| `ControlPointIndexRange` | The control-point indices a draw reads span more bytes (`needed`) than one storage-buffer descriptor can bind (`limit`, `maxStorageBufferRange`) | at the device's limit | 1: `crates/metal2vulkan/src/bind/graphics.rs:3849` | `rare`: control-point indices past one storage descriptor | | `MissingStageInRegion` | The kernel reads the compute encoder's stage-in region (a `[[stage_in]]` attribute stepping by thread position, or `[[grid_origin]]` or... | at the device's limit | 1: `crates/metal2vulkan/src/bind/dispatch.rs:796` | `none`: a stage-in region never set, which Metal leaves undefined | -| `UniformViewAliased` | A `device` buffer slot the pipeline reads through a uniform view (Profile F's per-stage storage-buffer fallback,... | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:607` | `rare`: Profile F's uniform-view fallback aliased by a write | +| `UniformViewAliased` | A `device` buffer slot the pipeline reads through a uniform view (Profile F's per-stage storage-buffer fallback,... | at the device's limit | 1: `crates/metal2vulkan/src/bind/instantiate.rs:609` | `rare`: Profile F's uniform-view fallback aliased by a write | | `MissingDeviceAddress` | A device-address slot received a buffer without a device address | at the device's limit | 1: `crates/metal2vulkan/src/bind/plan/slots.rs:133` | `rare`: a slot reached through a pointer loaded from memory, bound with inline bytes or on a device without device addresses | ## 5. Translation caps (`Error::LimitExceeded(Limit)`) @@ -278,11 +277,11 @@ Generated at `545ff3a77`. | Variant | What it blocks | Where | Sites | Reach | |---|---|---|---|---| -| `ScreenExtent` | A screen extent above 16384 | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:501` | `rare`: a rate map whose screen is past 16384 a side | -| `LayerCount` | More than two layers | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:505` | `none`: a rate map of more than two layers, which Apple's compile crashes on | -| `DenseSamples` | An axis with more quality samples than its screen extent plus one | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:516` | `rare`: a rate map axis with more quality samples than screen pixels | -| `SampleOutOfRange` | A sample outside `[0, 1]` (or `NaN`) on an axis of two or more samples | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:524` | `rare`: a rate map quality sample outside [0, 1] among others | -| `SampleCount` | An axis of more samples, not all equal, than the most measured on a map of its layer count, `max` | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:532` | `rare`: a rate map axis of more distinct samples than measured (9 on one layer, 4 on two) | +| `ScreenExtent` | A screen extent above 16384 | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 2: `crates/metal2vulkan-runtime/src/rate_map.rs:431`, `crates/metal2vulkan/src/bind/rate_map.rs:524` | `rare`: a rate map whose screen is past 16384 a side | +| `LayerCount` | More than two layers | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:528` | `none`: a rate map of more than two layers, which Apple's compile crashes on | +| `DenseSamples` | An axis with more quality samples than its screen extent plus one | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:539` | `rare`: a rate map axis with more quality samples than screen pixels | +| `SampleOutOfRange` | A sample outside `[0, 1]` (or `NaN`) on an axis of two or more samples | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:547` | `rare`: a rate map quality sample outside [0, 1] among others | +| `SampleCount` | An axis of more samples, not all equal, than the most measured on a map of its layer count, `max` | every device (this crate's bound: Apple's compile unmeasured or crashing there) | 1: `crates/metal2vulkan/src/bind/rate_map.rs:555` | `rare`: a rate map axis of more distinct samples than measured (9 on one layer, 4 on two) | ## 7. The translation deadline (`Error::Budget`; the runtime's `Error::Compile(Budget)`) @@ -310,7 +309,7 @@ Each refusal's sites, with the function that builds it. - `feature::SimdWidth`: `crates/metal2vulkan/src/device/subgroup.rs:377 (subgroup_tier)`; `crates/metal2vulkan/src/lower/simd/mod.rs:382 (finish)` - `feature::LocalSize`: `crates/metal2vulkan/src/bind/dispatch.rs:475 (regions)` - `feature::IrreducibleConvergent`: `crates/metal2vulkan/src/structurize/irreducible.rs:108 (refuse_tangled)` -- `feature::ComputeDerivativesWithSimd`: `crates/metal2vulkan/src/lower/dispatch.rs:472 (plan_kernel)` +- `feature::ComputeDerivativesWithSimd`: `crates/metal2vulkan/src/lower/dispatch.rs:476 (plan_kernel)` - `feature::ComputeDerivatives`: `crates/metal2vulkan/src/bind/dispatch.rs:320 (check_local)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:486 (select_derivative)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:495 (select_derivative)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:499 (select_derivative)` - `feature::QuadOperations`: `crates/metal2vulkan/src/device/subgroup.rs:371 (subgroup_tier)`; `crates/metal2vulkan/src/device/subgroup.rs:405 (subgroup_tier)` - `feature::SimdgroupMatrix`: `crates/metal2vulkan/src/lower/simd/matrix.rs:83 (not_implemented)` @@ -326,11 +325,11 @@ Each refusal's sites, with the function that builds it. - `feature::CoherentMemory`: `crates/metal2vulkan/src/lower/sync/memory_model.rs:207 (check)` - `feature::Int64Atomics`: `crates/metal2vulkan/src/lower/access/atomic.rs:624 (select)`; `crates/metal2vulkan/src/lower/access/atomic.rs:633 (select)` - `feature::ImageAtomics`: `crates/metal2vulkan-runtime/src/families/formats.rs:464 (atomic_gap)`; `crates/metal2vulkan-runtime/src/families/formats.rs:468 (atomic_gap)`; `crates/metal2vulkan/src/lower/texture/slot.rs:900 (atomic_format)` -- `feature::DescriptorCount`: `crates/metal2vulkan/src/lower/access/mod.rs:1684 (accept_placement)`; `crates/metal2vulkan/src/lower/select.rs:1641 (finish)`; `crates/metal2vulkan/src/pipeline/link.rs:1135 (limit_error)` -- `feature::BufferRange`: `crates/metal2vulkan-runtime/src/function_table.rs:569 (past_storage_buffer_range)`; `crates/metal2vulkan/src/bind/graphics.rs:3658 (patch_binding)`; `crates/metal2vulkan/src/bind/graphics.rs:3702 (patch_binding)`; `crates/metal2vulkan/src/bind/graphics.rs:3740 (patch_binding)`; `crates/metal2vulkan/src/bind/instantiate.rs:659 (bind_buffers)`; `crates/metal2vulkan/src/lower/access/function_table.rs:226 (select)`; `crates/metal2vulkan/src/lower/access/mod.rs:1184 (place_slots)` +- `feature::DescriptorCount`: `crates/metal2vulkan/src/lower/access/mod.rs:1688 (accept_placement)`; `crates/metal2vulkan/src/lower/select.rs:1641 (finish)`; `crates/metal2vulkan/src/pipeline/link.rs:1135 (limit_error)` +- `feature::BufferRange`: `crates/metal2vulkan-runtime/src/function_table.rs:569 (past_storage_buffer_range)`; `crates/metal2vulkan/src/bind/graphics.rs:3772 (patch_binding)`; `crates/metal2vulkan/src/bind/graphics.rs:3816 (patch_binding)`; `crates/metal2vulkan/src/bind/graphics.rs:3854 (patch_binding)`; `crates/metal2vulkan/src/bind/instantiate.rs:661 (bind_buffers)`; `crates/metal2vulkan/src/lower/access/function_table.rs:226 (select)`; `crates/metal2vulkan/src/lower/access/mod.rs:1184 (place_slots)` - `feature::Int64Arithmetic`: `crates/metal2vulkan/src/lower/arith/legal.rs:582 (check_scalar)`; `crates/metal2vulkan/src/lower/select.rs:1133 (selector_form)` - `feature::Float64Arithmetic`: `crates/metal2vulkan/src/device/metal.rs:230 (unsupported_features)`; `crates/metal2vulkan/src/lower/arith/legal.rs:587 (check_scalar)` -- `feature::Format`: `crates/metal2vulkan-runtime/src/binding_view.rs:146 (binding_view)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:523 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:530 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:545 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:602 (pair_unit)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:694 (plan_levels_copy)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:2206 (through_buffer)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:519 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:582 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:614 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:851 (texture_buffer_texel)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:270 (colour_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:298 (copy_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:344 (copy_unit)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:346 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:526 (usable_twin)`; `crates/metal2vulkan-runtime/src/families/features.rs:1625 (read_write_tier)`; `crates/metal2vulkan-runtime/src/families/formats.rs:1628 (sparse_missing)`; `crates/metal2vulkan-runtime/src/families/formats.rs:227 (none)`; `crates/metal2vulkan-runtime/src/families/formats.rs:271 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:291 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:306 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:353 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:392 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:474 (atomic_gap)`; `crates/metal2vulkan-runtime/src/families/formats.rs:508 (lacking)`; `crates/metal2vulkan-runtime/src/families/formats.rs:522 (unsupported)`; `crates/metal2vulkan-runtime/src/image_plan.rs:544 (check_own_memory)`; `crates/metal2vulkan-runtime/src/image_plan.rs:670 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:787 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:907 (plan_held)`; `crates/metal2vulkan-runtime/src/render.rs:2292 (viewing)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1031 (check_target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1369 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1709 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1802 (attachment_format)`; `crates/metal2vulkan-runtime/src/resolve.rs:409 (unmodelled_resolve)`; `crates/metal2vulkan-runtime/src/resolve.rs:616 (color)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:176 (checked_twin)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:204 (plan)`; `crates/metal2vulkan-runtime/src/sample_interleave.rs:301 (interleave_merge)`; `crates/metal2vulkan-runtime/src/shadow.rs:648 (unmerged)`; `crates/metal2vulkan-runtime/src/shadow.rs:655 (unmerged)`; `crates/metal2vulkan-runtime/src/texture.rs:2047 (texture_as)`; `crates/metal2vulkan-runtime/src/texture.rs:3588 (two_planes_refused)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:498 (astc_texels)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:534 (etc_texels)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1949 (planned_heap_texture)`; `crates/metal2vulkan-runtime/src/texture/surface_two_planes.rs:80 (refused)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:115 (converted_storage)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:278 (ycbcr_write_shadow)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:384 (new_render_shadow)`; `crates/metal2vulkan-runtime/src/two_planes.rs:150 (unmeasured)`; `crates/metal2vulkan-runtime/src/view_plan.rs:380 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:393 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:400 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:412 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:422 (check_format)`; `crates/metal2vulkan-runtime/src/ycbcr.rs:285 (refused)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:184 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1134 (plain_texture)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1814 (extended_sampler)`; `crates/metal2vulkan/src/bind/plan/resources.rs:193 (require_filter_features)`; `crates/metal2vulkan/src/bind/plan/resources.rs:959 (plain_texture)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:304 (finish)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:328 (interleave_split_module)`; `crates/metal2vulkan/src/bind/shadow_copy_in.rs:259 (shadow_copy_in_module)`; `crates/metal2vulkan/src/bind/unused_bits.rs:687 (unused_bits_module)`; `crates/metal2vulkan/src/lower/access/tile.rs:1029 (storage_format)`; `crates/metal2vulkan/src/lower/fragment/color.rs:160 (select_param)`; `crates/metal2vulkan/src/lower/fragment/color.rs:166 (select_param)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1202 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1223 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1229 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1235 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1260 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1437 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1873 (select_read)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1979 (select_output)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:2006 (select_output)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:2025 (select_output)`; `crates/metal2vulkan/src/lower/sampler/select.rs:1093 (select_extended)`; `crates/metal2vulkan/src/lower/sampler/select.rs:691 (texel_in)`; `crates/metal2vulkan/src/lower/stage_io/extended_color.rs:77 (plan)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2355 (entry)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:896 (zeroed_output)`; `crates/metal2vulkan/src/lower/stage_io/word_color.rs:83 (plan)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2360 (select)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3002 (cross_class)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3174 (select_image)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3344 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3381 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3714 (select_write)`; `crates/metal2vulkan/src/lower/texture/slot.rs:1035 (declare_slot)`; `crates/metal2vulkan/src/lower/texture/slot.rs:1048 (declare_slot)`; `crates/metal2vulkan/src/lower/texture/slot.rs:1054 (declare_slot)`; `crates/metal2vulkan/src/lower/texture/slot.rs:739 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:742 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:753 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:771 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:791 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:815 (ulong_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:826 (ulong_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:873 (ulong_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:908 (atomic_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:917 (atomic_format)`; `crates/metal2vulkan/src/metal/format/mod.rs:1693 (vk_format)`; `crates/metal2vulkan/src/metal/format/mod.rs:1695 (vk_format)`; `crates/metal2vulkan/src/metal/format/mod.rs:1825 (candidates)`; `crates/metal2vulkan/src/metal/format/mod.rs:2783 (storage_choice_viewed)`; `crates/metal2vulkan/src/metal/format/mod.rs:2801 (held_storage_choice)`; `crates/metal2vulkan/src/metal/format/mod.rs:2809 (held_storage_choice)`; `crates/metal2vulkan/src/metal/format/mod.rs:2906 (held_storage_choice)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:1100 (extended_write_mask)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:428 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:474 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:546 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:969 (reads_alpha_to_coverage)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:990 (reads_alpha_to_coverage)`; `crates/metal2vulkan/src/pipeline/rotated_blend.rs:449 (rotated_blend)`; `crates/metal2vulkan/src/pipeline/rotated_blend.rs:593 (alpha_in_red_blend)` +- `feature::Format`: `crates/metal2vulkan-runtime/src/binding_view.rs:146 (binding_view)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:523 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:530 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:545 (check_formats)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:602 (pair_unit)`; `crates/metal2vulkan-runtime/src/blit_plan.rs:694 (plan_levels_copy)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:2206 (through_buffer)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:519 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:582 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:614 (make_texture_over)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:851 (texture_buffer_texel)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:270 (colour_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:298 (copy_unit)`; `crates/metal2vulkan-runtime/src/copy_plan.rs:344 (copy_unit)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:346 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:526 (usable_twin)`; `crates/metal2vulkan-runtime/src/families/features.rs:1625 (read_write_tier)`; `crates/metal2vulkan-runtime/src/families/formats.rs:1628 (sparse_missing)`; `crates/metal2vulkan-runtime/src/families/formats.rs:227 (none)`; `crates/metal2vulkan-runtime/src/families/formats.rs:271 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:291 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:306 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:353 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:392 (answers)`; `crates/metal2vulkan-runtime/src/families/formats.rs:474 (atomic_gap)`; `crates/metal2vulkan-runtime/src/families/formats.rs:508 (lacking)`; `crates/metal2vulkan-runtime/src/families/formats.rs:522 (unsupported)`; `crates/metal2vulkan-runtime/src/image_plan.rs:544 (check_own_memory)`; `crates/metal2vulkan-runtime/src/image_plan.rs:670 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:787 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:907 (plan_held)`; `crates/metal2vulkan-runtime/src/render.rs:2295 (viewing)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1031 (check_target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1369 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1709 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1802 (attachment_format)`; `crates/metal2vulkan-runtime/src/resolve.rs:409 (unmodelled_resolve)`; `crates/metal2vulkan-runtime/src/resolve.rs:616 (color)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:176 (checked_twin)`; `crates/metal2vulkan-runtime/src/sample_copy.rs:204 (plan)`; `crates/metal2vulkan-runtime/src/sample_interleave.rs:303 (interleave_merge)`; `crates/metal2vulkan-runtime/src/shadow.rs:649 (unmerged)`; `crates/metal2vulkan-runtime/src/shadow.rs:656 (unmerged)`; `crates/metal2vulkan-runtime/src/texture.rs:2056 (texture_as)`; `crates/metal2vulkan-runtime/src/texture.rs:3602 (two_planes_refused)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:498 (astc_texels)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:534 (etc_texels)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1951 (planned_heap_texture)`; `crates/metal2vulkan-runtime/src/texture/surface_two_planes.rs:80 (refused)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:121 (converted_storage)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:389 (ycbcr_write_shadow)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:495 (new_render_shadow)`; `crates/metal2vulkan-runtime/src/two_planes.rs:150 (unmeasured)`; `crates/metal2vulkan-runtime/src/view_plan.rs:381 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:394 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:401 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:413 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:423 (check_format)`; `crates/metal2vulkan-runtime/src/ycbcr.rs:291 (refused)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:184 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1134 (plain_texture)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1814 (extended_sampler)`; `crates/metal2vulkan/src/bind/plan/resources.rs:193 (require_filter_features)`; `crates/metal2vulkan/src/bind/plan/resources.rs:959 (plain_texture)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:304 (finish)`; `crates/metal2vulkan/src/bind/sample_interleave.rs:328 (interleave_split_module)`; `crates/metal2vulkan/src/bind/shadow_copy_in.rs:259 (shadow_copy_in_module)`; `crates/metal2vulkan/src/bind/unused_bits.rs:687 (unused_bits_module)`; `crates/metal2vulkan/src/lower/access/tile.rs:1029 (storage_format)`; `crates/metal2vulkan/src/lower/fragment/color.rs:160 (select_param)`; `crates/metal2vulkan/src/lower/fragment/color.rs:166 (select_param)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1202 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1223 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1229 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1235 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1260 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1437 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1873 (select_read)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1979 (select_output)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:2006 (select_output)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:2025 (select_output)`; `crates/metal2vulkan/src/lower/sampler/select.rs:1093 (select_extended)`; `crates/metal2vulkan/src/lower/sampler/select.rs:691 (texel_in)`; `crates/metal2vulkan/src/lower/stage_io/extended_color.rs:77 (plan)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2355 (entry)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:896 (zeroed_output)`; `crates/metal2vulkan/src/lower/stage_io/word_color.rs:83 (plan)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2366 (select)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3008 (cross_class)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3180 (select_image)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3350 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3387 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3720 (select_write)`; `crates/metal2vulkan/src/lower/texture/slot.rs:1035 (declare_slot)`; `crates/metal2vulkan/src/lower/texture/slot.rs:1048 (declare_slot)`; `crates/metal2vulkan/src/lower/texture/slot.rs:1054 (declare_slot)`; `crates/metal2vulkan/src/lower/texture/slot.rs:739 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:742 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:753 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:771 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:791 (storage_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:815 (ulong_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:826 (ulong_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:873 (ulong_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:908 (atomic_format)`; `crates/metal2vulkan/src/lower/texture/slot.rs:917 (atomic_format)`; `crates/metal2vulkan/src/metal/format/mod.rs:1693 (vk_format)`; `crates/metal2vulkan/src/metal/format/mod.rs:1695 (vk_format)`; `crates/metal2vulkan/src/metal/format/mod.rs:1825 (candidates)`; `crates/metal2vulkan/src/metal/format/mod.rs:2788 (storage_choice_viewed)`; `crates/metal2vulkan/src/metal/format/mod.rs:2806 (held_storage_choice)`; `crates/metal2vulkan/src/metal/format/mod.rs:2814 (held_storage_choice)`; `crates/metal2vulkan/src/metal/format/mod.rs:2911 (held_storage_choice)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:1100 (extended_write_mask)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:428 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:474 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:546 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:969 (reads_alpha_to_coverage)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:990 (reads_alpha_to_coverage)`; `crates/metal2vulkan/src/pipeline/rotated_blend.rs:449 (rotated_blend)`; `crates/metal2vulkan/src/pipeline/rotated_blend.rs:593 (alpha_in_red_blend)` - `feature::DivergentImplicitLod`: `crates/metal2vulkan/src/lower/sampler/select.rs:352 (select_sampling)` - `feature::ImplicitLodOutsideFragment`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:136 (query_min_level)`; `crates/metal2vulkan/src/lower/sampler/select.rs:229 (query_level_measured)`; `crates/metal2vulkan/src/lower/sampler/select.rs:255 (query_min_level)` - `feature::MinLodClamp`: `crates/metal2vulkan/src/lower/sampler/select.rs:1572 (select_one)`; `crates/metal2vulkan/src/lower/sampler/select.rs:973 (min_lod)` @@ -344,31 +343,31 @@ Each refusal's sites, with the function that builds it. - `feature::SamplerLodBias`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:258 (constexpr_desc)`; `crates/metal2vulkan/src/lower/sampler/constexpr.rs:265 (constexpr_desc)`; `crates/metal2vulkan/src/lower/sampler/constexpr.rs:271 (constexpr_desc)` - `feature::SamplerCompare`: `crates/metal2vulkan/src/metal/sampler.rs:260 (check_sampler)` - `feature::PixelSamplerCompare`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:115 (lowered)` -- `feature::TexelBuffer`: `crates/metal2vulkan/src/bind/instantiate.rs:880 (texel_ranges)`; `crates/metal2vulkan/src/bind/instantiate.rs:886 (texel_ranges)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1147 (plain_texture)` +- `feature::TexelBuffer`: `crates/metal2vulkan/src/bind/instantiate.rs:882 (texel_ranges)`; `crates/metal2vulkan/src/bind/instantiate.rs:888 (texel_ranges)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1147 (plain_texture)` - `feature::RasterOrderGroups`: `crates/metal2vulkan/src/device/metal.rs:242 (unsupported_features)`; `crates/metal2vulkan/src/lower/fragment/rog.rs:151 (mode)`; `crates/metal2vulkan/src/lower/fragment/rog.rs:172 (mode)`; `crates/metal2vulkan/src/lower/fragment/snapshot.rs:158 (finish)` -- `feature::FramebufferFetch`: `crates/metal2vulkan-runtime/src/families/features.rs:1018 (state)`; `crates/metal2vulkan-runtime/src/render.rs:5894 (next_instance)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:120 (lacks)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:147 (new)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:518 (planes_merge)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:190 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/sample_planes.rs:477 (finish)`; `crates/metal2vulkan/src/device/metal.rs:252 (unsupported_features)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1218 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1236 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1250 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1293 (packed16)`; `crates/metal2vulkan/src/lower/fragment/color.rs:215 (select_param)`; `crates/metal2vulkan/src/lower/fragment/color.rs:279 (unordered)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:195 (not_implemented)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:272 (depth_test_form)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:318 (stencil_test_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1087 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1178 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1215 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1827 (plan_sample)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:789 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/fetch.rs:164 (storage_attachments)` +- `feature::FramebufferFetch`: `crates/metal2vulkan-runtime/src/families/features.rs:1018 (state)`; `crates/metal2vulkan-runtime/src/render.rs:5897 (next_instance)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:120 (lacks)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:147 (new)`; `crates/metal2vulkan-runtime/src/sample_planes.rs:518 (planes_merge)`; `crates/metal2vulkan/src/bind/extended_shadow.rs:190 (extended_shadow_module)`; `crates/metal2vulkan/src/bind/sample_planes.rs:477 (finish)`; `crates/metal2vulkan/src/device/metal.rs:252 (unsupported_features)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1218 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1236 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1250 (unorm8)`; `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:1293 (packed16)`; `crates/metal2vulkan/src/lower/fragment/color.rs:215 (select_param)`; `crates/metal2vulkan/src/lower/fragment/color.rs:279 (unordered)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:195 (not_implemented)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:272 (depth_test_form)`; `crates/metal2vulkan/src/lower/fragment/depth_test.rs:318 (stencil_test_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1087 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1178 (storage_form)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1215 (extended_range_blend)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1827 (plan_sample)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:789 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/fetch.rs:164 (storage_attachments)` - `feature::PrimitiveId`: `crates/metal2vulkan-runtime/src/families/features.rs:1127 (state)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:3211 (finish)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:240 (check_primitive_id)` - `feature::PrivatePrimitives`: `crates/metal2vulkan/src/lower/stage_io/plan.rs:2601 (indices_feature)` -- `feature::VertexAmplification`: `crates/metal2vulkan/src/bind/graphics.rs:3999 (multiview_instances)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1312 (own_index_store)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:718 (select_param)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:258 (vertex_amplification)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:228 (control_plan)` -- `feature::LayeredRendering`: `crates/metal2vulkan-runtime/src/render_pass.rs:1669 (target)`; `crates/metal2vulkan-runtime/src/render_state.rs:1107 (needs_viewports)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:781 (target_index)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:800 (target_index)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1313 (own_index_store)`; `crates/metal2vulkan/src/pipeline/link/geometry.rs:150 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/geometry.rs:172 (refused)` -- `feature::ClipDistance`: `crates/metal2vulkan/src/lower/mesh/mod.rs:941 (select)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:949 (select)` +- `feature::VertexAmplification`: `crates/metal2vulkan/src/bind/graphics.rs:4113 (multiview_instances)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1312 (own_index_store)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:718 (select_param)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:258 (vertex_amplification)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:228 (control_plan)` +- `feature::LayeredRendering`: `crates/metal2vulkan-runtime/src/render_pass.rs:1669 (target)`; `crates/metal2vulkan-runtime/src/render_state.rs:1107 (needs_viewports)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:796 (target_index)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:815 (target_index)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1313 (own_index_store)`; `crates/metal2vulkan/src/pipeline/link/geometry.rs:150 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/geometry.rs:172 (refused)` +- `feature::ClipDistance`: `crates/metal2vulkan/src/lower/mesh/mod.rs:956 (select)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:964 (select)` - `feature::DualSourceBlending`: `crates/metal2vulkan-runtime/src/families/formats.rs:386 (answers)`; `crates/metal2vulkan/src/metal/state.rs:37 (blend_factor)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:1157 (check_outputs)`; `crates/metal2vulkan/src/pipeline/rotated_blend.rs:463 (rotated_blend)`; `crates/metal2vulkan/src/pipeline/rotated_blend.rs:538 (rotated_blend)` - `feature::Barycentrics`: `crates/metal2vulkan/src/device/metal.rs:263 (unsupported_features)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1924 (input_builtin)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:745 (param)`; `crates/metal2vulkan/src/pipeline/link/geometry.rs:148 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/geometry.rs:170 (refused)` -- `feature::StencilExport`: `crates/metal2vulkan-runtime/src/families/features.rs:1114 (state)`; `crates/metal2vulkan/src/bind/graphics.rs:2685 (shadow_stencil_words)`; `crates/metal2vulkan/src/lower/fragment/stencil.rs:157 (device_form)`; `crates/metal2vulkan/src/lower/fragment/stencil.rs:168 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/stencil.rs:55 (shadow_stencil)`; `crates/metal2vulkan/src/pipeline/link/stencil.rs:73 (shadow_stencil)` +- `feature::StencilExport`: `crates/metal2vulkan-runtime/src/families/features.rs:1114 (state)`; `crates/metal2vulkan/src/bind/graphics.rs:2719 (shadow_stencil_words)`; `crates/metal2vulkan/src/lower/fragment/stencil.rs:157 (device_form)`; `crates/metal2vulkan/src/lower/fragment/stencil.rs:168 (not_implemented)`; `crates/metal2vulkan/src/pipeline/link/stencil.rs:55 (shadow_stencil)`; `crates/metal2vulkan/src/pipeline/link/stencil.rs:73 (shadow_stencil)` - `feature::SampleRateShading`: `crates/metal2vulkan/src/pipeline/link/graphics.rs:844 (sample_invocations)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:846 (sample_invocations)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:928 (sample_invocations)` - `feature::PixelCoverageAtSampleRate`: `crates/metal2vulkan/src/lower/fragment/coverage.rs:296 (finish)`; `crates/metal2vulkan/src/lower/simd/mod.rs:754 (select_param)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:879 (sample_invocations)` - `feature::InterfaceComponents`: `crates/metal2vulkan/src/pipeline/compile/color_group.rs:202 (refusal)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:301 (graphics_state)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:409 (assign)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:90 (limit_error)` - `feature::UnmatchedVarying`: `crates/metal2vulkan/src/pipeline/link/varyings.rs:318 (mesh_fragment)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:537 (varyings)`; `crates/metal2vulkan/src/pipeline/link/varyings.rs:548 (varyings)` - `feature::KernelStageIn`: `crates/metal2vulkan-runtime/src/indirect_execute.rs:376 (record)`; `crates/metal2vulkan/src/bind/dispatch.rs:871 (instantiate)`; `crates/metal2vulkan/src/lower/stage_io/stage_in.rs:133 (select)` -- `feature::Tessellation`: `crates/metal2vulkan-air/src/canon/mod.rs:1256 (post_check)`; `crates/metal2vulkan-air/src/canon/mod.rs:1347 (post_check)`; `crates/metal2vulkan/src/bind/graphics.rs:3856 (tessellation_dispatch)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs:519 (select)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1508 (primitive_id_output)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1794 (input_builtin)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:828 (param)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:150 (not_implemented)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:489 (plan_entry)`; `crates/metal2vulkan/src/metal/vertex.rs:219 (fetch_as)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:212 (control_plan)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:292 (check_fragment)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:316 (push_offset)` -- `feature::MeshShading`: `crates/metal2vulkan/src/bind/graphics.rs:1604 (plan)`; `crates/metal2vulkan/src/bind/graphics.rs:3058 (mesh_limit)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:502 (check_payload)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:541 (plan_entry)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:575 (plan_entry)`; `crates/metal2vulkan/src/memory/plan.rs:2056 (reprs)`; `crates/metal2vulkan/src/pipeline/link/mesh.rs:102 (records)` -- `feature::TileShading`: `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:520 (scratch)`; `crates/metal2vulkan/src/bind/plan/compute.rs:237 (tile_memory)`; `crates/metal2vulkan/src/lower/access/tile.rs:151 (not_implemented)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:275 (tile_shading)`; `crates/metal2vulkan/src/pipeline/compile/api.rs:699 (tile_pipeline)` -- `feature::Imageblocks`: `crates/metal2vulkan/src/lower/access/imageblock.rs:98 (imageblocks)`; `crates/metal2vulkan/src/lower/access/mod.rs:908 (select_param)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:104 (require)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:412 (reach)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:554 (plan_tests)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:578 (plan_tests)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:86 (not_implemented)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2370 (select)`; `crates/metal2vulkan/src/lower/texture/slice.rs:139 (imageblocks)`; `crates/metal2vulkan/src/pipeline/link/imageblock.rs:50 (fragment_imageblock)` +- `feature::Tessellation`: `crates/metal2vulkan-air/src/canon/mod.rs:1256 (post_check)`; `crates/metal2vulkan-air/src/canon/mod.rs:1347 (post_check)`; `crates/metal2vulkan/src/bind/graphics.rs:3970 (tessellation_dispatch)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs:519 (select)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1508 (primitive_id_output)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:1794 (input_builtin)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:828 (param)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:150 (not_implemented)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:489 (plan_entry)`; `crates/metal2vulkan/src/metal/vertex.rs:219 (fetch_as)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:212 (control_plan)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:292 (check_fragment)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:316 (push_offset)` +- `feature::MeshShading`: `crates/metal2vulkan/src/bind/graphics.rs:1630 (plan)`; `crates/metal2vulkan/src/bind/graphics.rs:3095 (mesh_limit)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:517 (check_payload)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:556 (plan_entry)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:590 (plan_entry)`; `crates/metal2vulkan/src/memory/plan.rs:2056 (reprs)`; `crates/metal2vulkan/src/pipeline/link/mesh.rs:102 (records)` +- `feature::TileShading`: `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:520 (scratch)`; `crates/metal2vulkan/src/bind/plan/compute.rs:237 (tile_memory)`; `crates/metal2vulkan/src/lower/access/tile.rs:151 (not_implemented)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:275 (tile_shading)`; `crates/metal2vulkan/src/pipeline/compile/api.rs:702 (tile_pipeline)` +- `feature::Imageblocks`: `crates/metal2vulkan/src/lower/access/imageblock.rs:98 (imageblocks)`; `crates/metal2vulkan/src/lower/access/mod.rs:908 (select_param)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:104 (require)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:412 (reach)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:554 (plan_tests)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:578 (plan_tests)`; `crates/metal2vulkan/src/lower/fragment/imageblock.rs:86 (not_implemented)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2376 (select)`; `crates/metal2vulkan/src/lower/texture/slice.rs:139 (imageblocks)`; `crates/metal2vulkan/src/pipeline/link/imageblock.rs:50 (fragment_imageblock)` - `feature::RayTracing`: `crates/metal2vulkan/src/bind/acceleration.rs:202 (instance_record)`; `crates/metal2vulkan/src/bind/acceleration.rs:216 (instance_record)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1087 (primitive_data_read)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1202 (instance_count)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1245 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1257 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1282 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1297 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1312 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:344 (slot_of)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:385 (select_param)`; `crates/metal2vulkan/src/lower/select.rs:899 (route_air)` - `feature::Tensors`: `crates/metal2vulkan-air/src/canon/matmul2d/synth.rs:32 (refuse)`; `crates/metal2vulkan/src/lower/select.rs:903 (route_air)` - `feature::RasterizationRateMap`: `crates/metal2vulkan/src/lower/fragment/mod.rs:930 (select)` -- `feature::GpuEncodedIndirectCommands`: `crates/metal2vulkan/src/bind/replay.rs:556 (preprocess)`; `crates/metal2vulkan/src/bind/replay.rs:796 (replay_preprocess_module)`; `crates/metal2vulkan/src/bind/replay/draws.rs:280 (draw_replay_preprocess)`; `crates/metal2vulkan/src/bind/replay/draws.rs:482 (draw_replay_module)`; `crates/metal2vulkan/src/bind/replay/flat.rs:247 (flat_dispatch_module)`; `crates/metal2vulkan/src/bind/replay/merged.rs:242 (draw_merge_module)`; `crates/metal2vulkan/src/lower/access/encode.rs:394 (needs)`; `crates/metal2vulkan/src/lower/access/encode.rs:410 (needs)`; `crates/metal2vulkan/src/lower/access/encode.rs:527 (select_command)`; `crates/metal2vulkan/src/lower/access/mod.rs:1539 (plan_replay)`; `crates/metal2vulkan/src/lower/access/mod.rs:1562 (plan_replay)`; `crates/metal2vulkan/src/lower/access/mod.rs:1565 (plan_replay)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2707 (merged)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2763 (finish_merged)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:458 (param)`; `crates/metal2vulkan/src/pipeline/compile.rs:2126 (plan_one)`; `crates/metal2vulkan/src/pipeline/compile.rs:2131 (plan_one)` -- `feature::VulkanVersion`: `crates/metal2vulkan/src/ash_interop/query.rs:926 (query)`; `crates/metal2vulkan/src/device/derive.rs:105 (with_deviations)` +- `feature::GpuEncodedIndirectCommands`: `crates/metal2vulkan/src/bind/replay.rs:556 (preprocess)`; `crates/metal2vulkan/src/bind/replay.rs:796 (replay_preprocess_module)`; `crates/metal2vulkan/src/bind/replay/draws.rs:280 (draw_replay_preprocess)`; `crates/metal2vulkan/src/bind/replay/draws.rs:482 (draw_replay_module)`; `crates/metal2vulkan/src/bind/replay/flat.rs:247 (flat_dispatch_module)`; `crates/metal2vulkan/src/bind/replay/merged.rs:242 (draw_merge_module)`; `crates/metal2vulkan/src/lower/access/encode.rs:394 (needs)`; `crates/metal2vulkan/src/lower/access/encode.rs:410 (needs)`; `crates/metal2vulkan/src/lower/access/encode.rs:527 (select_command)`; `crates/metal2vulkan/src/lower/access/mod.rs:1540 (plan_replay)`; `crates/metal2vulkan/src/lower/access/mod.rs:1566 (plan_replay)`; `crates/metal2vulkan/src/lower/access/mod.rs:1569 (plan_replay)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2707 (merged)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2763 (finish_merged)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:458 (param)`; `crates/metal2vulkan/src/pipeline/compile.rs:2126 (plan_one)`; `crates/metal2vulkan/src/pipeline/compile.rs:2131 (plan_one)` +- `feature::VulkanVersion`: `crates/metal2vulkan/src/ash_interop/query.rs:927 (query)`; `crates/metal2vulkan/src/device/derive.rs:105 (with_deviations)` - `feature::Constant`: `crates/metal2vulkan-air/src/bitcode/constants.rs:210 (record)`; `crates/metal2vulkan-air/src/bitcode/constants.rs:268 (record)`; `crates/metal2vulkan/src/error/mod.rs:255 (from)` - `feature::Attribute`: `crates/metal2vulkan-air/src/bitcode/attrs.rs:493 (known)`; `crates/metal2vulkan/src/error/mod.rs:256 (from)` - `feature::BitcodeRecord`: `crates/metal2vulkan-air/src/bitcode/attrs.rs:337 (decode_lists)`; `crates/metal2vulkan-air/src/bitcode/function.rs:572 (symtab)`; `crates/metal2vulkan-air/src/bitcode/metadata.rs:130 (decode)`; `crates/metal2vulkan-air/src/bitcode/metadata.rs:157 (decode)`; `crates/metal2vulkan-air/src/bitcode/module.rs:727 (check_bodies)`; `crates/metal2vulkan-air/src/bitcode/module.rs:872 (symtab)`; `crates/metal2vulkan/src/error/mod.rs:257 (from)` @@ -376,15 +375,15 @@ Each refusal's sites, with the function that builds it. - `feature::SubgroupOperations`: `crates/metal2vulkan-runtime/src/families/features.rs:1713 (simd)`; `crates/metal2vulkan/src/lower/simd/mod.rs:407 (finish)`; `crates/metal2vulkan/src/lower/simd/mod.rs:466 (full_quads)`; `crates/metal2vulkan/src/lower/simd/mod.rs:990 (select_group)` - `feature::DirectCall`: `crates/metal2vulkan-air/src/canon/mod.rs:1319 (post_check)` - `feature::WideSwitchLiteral`: `crates/metal2vulkan/src/structurize/emit.rs:207 (check_tree)` -- `feature::Lowering`: `crates/metal2vulkan/src/bind/plan/resources.rs:762 (level_views)`; `crates/metal2vulkan/src/lower/access/handle.rs:1062 (texture_target)`; `crates/metal2vulkan/src/lower/access/handle.rs:1073 (sampler_target)`; `crates/metal2vulkan/src/lower/access/handle.rs:318 (domain_kind)`; `crates/metal2vulkan/src/lower/access/imageblock.rs:175 (operand)`; `crates/metal2vulkan/src/lower/access/mod.rs:571 (not_lowered)`; `crates/metal2vulkan/src/lower/access/pulled.rs:76 (share)`; `crates/metal2vulkan/src/lower/arith/legal.rs:53 (not_lowered)`; `crates/metal2vulkan/src/lower/dispatch.rs:114 (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs:144 (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs:653 (plan)`; `crates/metal2vulkan/src/lower/fragment/mod.rs:123 (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/snapshot.rs:168 (finish)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:149 (not_lowered)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:126 (not_lowered)`; `crates/metal2vulkan/src/lower/sampler/mod.rs:212 (refuse)`; `crates/metal2vulkan/src/lower/sampler/select.rs:30 (refuse)`; `crates/metal2vulkan/src/lower/select.rs:829 (not_lowered)`; `crates/metal2vulkan/src/lower/select.rs:918 (route_air)`; `crates/metal2vulkan/src/lower/simd/mod.rs:136 (not_lowered)`; `crates/metal2vulkan/src/lower/simd/mod.rs:747 (select_param)`; `crates/metal2vulkan/src/lower/simd/workgroup.rs:353 (check)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs:96 (not_lowered)`; `crates/metal2vulkan/src/lower/stage_io/mod.rs:182 (not_lowered)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:72 (not_lowered)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs:269 (not_implemented)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs:310 (select)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:146 (not_lowered)`; `crates/metal2vulkan/src/lower/texture/mod.rs:180 (refuse)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3683 (select_write)`; `crates/metal2vulkan/src/memory/alloca.rs:54 (not_lowered)`; `crates/metal2vulkan/src/memory/leaf.rs:183 (not_lowered)`; `crates/metal2vulkan/src/memory/plan.rs:490 (not_lowered)`; `crates/metal2vulkan/src/memory/provenance.rs:665 (not_lowered)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:96 (patch_fetch_projection)` +- `feature::Lowering`: `crates/metal2vulkan/src/bind/plan/resources.rs:762 (level_views)`; `crates/metal2vulkan/src/lower/access/handle.rs:1062 (texture_target)`; `crates/metal2vulkan/src/lower/access/handle.rs:1073 (sampler_target)`; `crates/metal2vulkan/src/lower/access/handle.rs:318 (domain_kind)`; `crates/metal2vulkan/src/lower/access/imageblock.rs:175 (operand)`; `crates/metal2vulkan/src/lower/access/mod.rs:571 (not_lowered)`; `crates/metal2vulkan/src/lower/access/pulled.rs:76 (share)`; `crates/metal2vulkan/src/lower/arith/legal.rs:53 (not_lowered)`; `crates/metal2vulkan/src/lower/dispatch.rs:114 (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs:144 (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/discard.rs:653 (plan)`; `crates/metal2vulkan/src/lower/fragment/mod.rs:123 (not_lowered)`; `crates/metal2vulkan/src/lower/fragment/snapshot.rs:168 (finish)`; `crates/metal2vulkan/src/lower/mesh/mod.rs:149 (not_lowered)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:126 (not_lowered)`; `crates/metal2vulkan/src/lower/sampler/mod.rs:212 (refuse)`; `crates/metal2vulkan/src/lower/sampler/select.rs:30 (refuse)`; `crates/metal2vulkan/src/lower/select.rs:829 (not_lowered)`; `crates/metal2vulkan/src/lower/select.rs:918 (route_air)`; `crates/metal2vulkan/src/lower/simd/mod.rs:136 (not_lowered)`; `crates/metal2vulkan/src/lower/simd/mod.rs:747 (select_param)`; `crates/metal2vulkan/src/lower/simd/workgroup.rs:353 (check)`; `crates/metal2vulkan/src/lower/stage_io/fetch.rs:96 (not_lowered)`; `crates/metal2vulkan/src/lower/stage_io/mod.rs:182 (not_lowered)`; `crates/metal2vulkan/src/lower/sync/barrier.rs:72 (not_lowered)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs:269 (not_implemented)`; `crates/metal2vulkan/src/lower/sync/memory_model.rs:310 (select)`; `crates/metal2vulkan/src/lower/tessellation/mod.rs:146 (not_lowered)`; `crates/metal2vulkan/src/lower/texture/mod.rs:185 (refuse)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3689 (select_write)`; `crates/metal2vulkan/src/memory/alloca.rs:54 (not_lowered)`; `crates/metal2vulkan/src/memory/leaf.rs:183 (not_lowered)`; `crates/metal2vulkan/src/memory/plan.rs:490 (not_lowered)`; `crates/metal2vulkan/src/memory/provenance.rs:665 (not_lowered)`; `crates/metal2vulkan/src/pipeline/link/tessellation/mod.rs:96 (patch_fetch_projection)` - `feature::SamplerAddressMode`: `crates/metal2vulkan/src/lower/sampler/constexpr.rs:176`; `crates/metal2vulkan/src/metal/sampler.rs:251 (check_sampler)` - `feature::AlphaToOne`: `crates/metal2vulkan/src/pipeline/link/graphics.rs:282 (graphics_state)` - `feature::StageStoresAndAtomics`: `crates/metal2vulkan/src/lower/access/tile_memory.rs:72 (written)` - `feature::FunctionConstantArgument`: `crates/metal2vulkan-air/src/canon/interface.rs:899 (absent_values)`; `crates/metal2vulkan/src/lower/access/absent.rs:100 (require)` - `feature::SamplerBicubicFilter`: `crates/metal2vulkan/src/bind/heap.rs:997 (new)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1876 (bicubic_texels)`; `crates/metal2vulkan/src/bind/plan/slots.rs:503 (cubic_variant)`; `crates/metal2vulkan/src/lower/sampler/bicubic.rs:120 (refuse)`; `crates/metal2vulkan/src/lower/sampler/select.rs:35 (bicubic_refused)` -- `feature::GroupCount`: `crates/metal2vulkan/src/bind/dispatch.rs:379 (product)`; `crates/metal2vulkan/src/bind/dispatch.rs:455`; `crates/metal2vulkan/src/bind/dispatch.rs:953 (instantiate)`; `crates/metal2vulkan/src/bind/graphics.rs:3272 (mesh_draw)`; `crates/metal2vulkan/src/bind/graphics.rs:3323 (emulated_draw)` +- `feature::GroupCount`: `crates/metal2vulkan/src/bind/dispatch.rs:379 (product)`; `crates/metal2vulkan/src/bind/dispatch.rs:455`; `crates/metal2vulkan/src/bind/dispatch.rs:953 (instantiate)`; `crates/metal2vulkan/src/bind/graphics.rs:3384 (mesh_draw)`; `crates/metal2vulkan/src/bind/graphics.rs:3437 (emulated_draw)` - `feature::IntersectionFunctionTable`: `crates/metal2vulkan/src/bind/acceleration.rs:177 (geometry_table_offset)`; `crates/metal2vulkan/src/bind/acceleration.rs:183 (geometry_table_offset)`; `crates/metal2vulkan/src/bind/acceleration.rs:188 (geometry_table_offset)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1222 (null_table)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1251 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:1272 (intersect)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:406 (table_of)`; `crates/metal2vulkan/src/lower/raytracing/mod.rs:422 (select_table)`; `crates/metal2vulkan/src/lower/select.rs:885 (route_air)` -- `feature::IndependentBlending`: `crates/metal2vulkan-runtime/src/render.rs:2173 (check_pipeline)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:1017 (uniform_blend)` +- `feature::IndependentBlending`: `crates/metal2vulkan-runtime/src/render.rs:2176 (check_pipeline)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:1017 (uniform_blend)` - `feature::RasterSampleCount`: `crates/metal2vulkan-runtime/src/families/limits.rs:1063 (sample_count)`; `crates/metal2vulkan/src/pipeline/graphics.rs:563 (sample_count_properties)` - `feature::TriangleFillLines`: `crates/metal2vulkan/src/metal/state.rs:347 (polygon_mode)` - `feature::DepthClipClamp`: `crates/metal2vulkan/src/metal/state.rs:363 (depth_clamp_enable)` @@ -393,13 +392,13 @@ Each refusal's sites, with the function that builds it. - `feature::SparseTexture`: `crates/metal2vulkan/src/bind/plan/slots.rs:583 (check_sparse_textures)`; `crates/metal2vulkan/src/bind/plan/slots.rs:607 (check_sparse_textures)` - `feature::TextureSize`: `crates/metal2vulkan-runtime/src/image_plan.rs:1196 (check_image_limits)` - `feature::TextureSampleCount`: `crates/metal2vulkan-runtime/src/image_plan.rs:1244 (check_image_limits)`; `crates/metal2vulkan-runtime/src/image_plan.rs:598 (plan_held)`; `crates/metal2vulkan-runtime/src/image_plan.rs:608 (plan_held)` -- `feature::TextureView`: `crates/metal2vulkan-runtime/src/binding_view.rs:156 (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs:5136 (view)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:1427 (make_second_twin)`; `crates/metal2vulkan-runtime/src/texture/view_shadow.rs:298 (apart_refusal)`; `crates/metal2vulkan-runtime/src/view_plan.rs:433 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:483 (check_view)`; `crates/metal2vulkan-runtime/src/view_plan.rs:505 (check_view)` -- `feature::TextureSwizzle`: `crates/metal2vulkan-runtime/src/binding_view.rs:167 (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs:996 (may_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1102 (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2587 (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3409 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3756 (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs:307 (select)` +- `feature::TextureView`: `crates/metal2vulkan-runtime/src/binding_view.rs:156 (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs:5150 (view)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs:1427 (make_second_twin)`; `crates/metal2vulkan-runtime/src/texture/view_shadow.rs:298 (apart_refusal)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs:302 (luma_view)`; `crates/metal2vulkan-runtime/src/view_plan.rs:434 (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs:486 (check_view)`; `crates/metal2vulkan-runtime/src/view_plan.rs:508 (check_view)` +- `feature::TextureSwizzle`: `crates/metal2vulkan-runtime/src/binding_view.rs:167 (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs:998 (may_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs:1102 (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2587 (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3415 (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs:3762 (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs:307 (select)` - `feature::MipmapGeneration`: `crates/metal2vulkan-runtime/src/blit_texture.rs:1890 (mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_pick.rs:37 (pick_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:262 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:270 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:275 (plan_mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs:304 (plan_mipmaps)`; `crates/metal2vulkan/src/bind/mipmap_filter.rs:973 (mipmap_filter_module)` - `feature::HostMemory`: `crates/metal2vulkan-runtime/src/host_memory.rs:430 (not_importable)`; `crates/metal2vulkan-runtime/src/host_memory.rs:470 (refuse_unwritable)`; `crates/metal2vulkan-runtime/src/host_memory.rs:689 (new)`; `crates/metal2vulkan-runtime/src/host_memory.rs:694 (new)`; `crates/metal2vulkan-runtime/src/host_memory.rs:712 (new)` -- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2814 (gpu_times)` +- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2876 (gpu_times)` - `feature::CountingVisibility`: `crates/metal2vulkan-runtime/src/visibility.rs:452 (check_mode)` -- `feature::ViewFormatReinterpretation`: `crates/metal2vulkan-runtime/src/view_plan.rs:570 (reinterpretation_refused)` +- `feature::ViewFormatReinterpretation`: `crates/metal2vulkan-runtime/src/view_plan.rs:573 (reinterpretation_refused)` - `feature::SeparateMultisampledDepthStencil`: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:188 (sampled_candidate)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:294 (by_draws)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:336 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:376 (scratch)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:777 (plan)`; `crates/metal2vulkan-runtime/src/nan_clear.rs:658 (nan_write)`; `crates/metal2vulkan-runtime/src/texture/signed_depth.rs:191 (sample_strip)` - `feature::PixelCoverage`: `crates/metal2vulkan-runtime/src/families/features.rs:1225 (state)`; `crates/metal2vulkan/src/pipeline/link/graphics.rs:783 (split_pixel_fragments)` - `feature::CentroidVarying`: `crates/metal2vulkan/src/pipeline/link/graphics.rs:801 (split_pixel_fragments)` @@ -408,35 +407,35 @@ Each refusal's sites, with the function that builds it. - `feature::SparseMapping`: `crates/metal2vulkan-runtime/src/sparse/encoder.rs:473 (splits_a_unit)` - `feature::TimelineSemaphores`: `crates/metal2vulkan-runtime/src/device/create.rs:1115 (timeline_difference)` - `feature::Reflection`: `crates/metal2vulkan/src/bind/argument_buffer.rs:626 (unmeasured)`; `crates/metal2vulkan/src/reflection/derive.rs:178 (specialized_reads)`; `crates/metal2vulkan/src/reflection/derive.rs:212 (read_attributes)`; `crates/metal2vulkan/src/reflection/derive.rs:239 (gap_at)`; `crates/metal2vulkan/src/reflection/function.rs:172 (unmeasured)`; `crates/metal2vulkan/src/reflection/function.rs:366 (attribute)`; `crates/metal2vulkan/src/reflection/function.rs:437 (module_constants)`; `crates/metal2vulkan/src/reflection/linked.rs:125 (function)`; `crates/metal2vulkan/src/reflection/mod.rs:249 (stage)` -- `feature::HeapTextureTiling`: `crates/metal2vulkan-runtime/src/texture/heap.rs:630 (tiling_refusal)` +- `feature::HeapTextureTiling`: `crates/metal2vulkan-runtime/src/texture/heap.rs:632 (tiling_refusal)` - `feature::ViewportDepthRange`: `crates/metal2vulkan-runtime/src/render_state.rs:1216 (depth_ranges_refused)` - `feature::UndeclaredTextureUsage`: `crates/metal2vulkan-runtime/src/binding_view.rs:141 (binding_view)`; `crates/metal2vulkan-runtime/src/texture/usage_shadow.rs:72 (refused)` - `feature::RenderTargetSize`: `crates/metal2vulkan-runtime/src/render_pass.rs:1271 (framebuffer_fits)` - `feature::IndirectRenderState`: `crates/metal2vulkan/src/lower/access/encode.rs:568 (select_command)` - `feature::GlobalBuiltinInFragment`: `crates/metal2vulkan/src/lower/select.rs:912 (route_air)` -- `feature::PrivateRenderState`: `crates/metal2vulkan/src/bind/heap.rs:1300 (array)`; `crates/metal2vulkan/src/bind/plan/resources.rs:887 (write_rounding)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2710 (clamps_reference)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:3445 (alpha_test_refused)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2920 (mode_rounded_write)`; `crates/metal2vulkan/src/pipeline/private_state.rs:115 (refused)`; `crates/metal2vulkan/src/pipeline/private_state.rs:449 (logic_operation)` +- `feature::PrivateRenderState`: `crates/metal2vulkan/src/bind/heap.rs:1300 (array)`; `crates/metal2vulkan/src/bind/plan/resources.rs:887 (write_rounding)`; `crates/metal2vulkan/src/lower/sampler/select.rs:2710 (clamps_reference)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:3445 (alpha_test_refused)`; `crates/metal2vulkan/src/lower/texture/mod.rs:2926 (mode_rounded_write)`; `crates/metal2vulkan/src/pipeline/private_state.rs:115 (refused)`; `crates/metal2vulkan/src/pipeline/private_state.rs:449 (logic_operation)` - `feature::ExtendedRangeBlend`: `crates/metal2vulkan/src/lower/arith/extended_range/blend.rs:305 (refused)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1578 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1581 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1658 (plan)`; `crates/metal2vulkan/src/lower/fragment/fetch.rs:1661 (plan)`; `crates/metal2vulkan/src/lower/fragment/input_blend.rs:153 (plan)` - `feature::TileReach`: `crates/metal2vulkan/src/bind/tile_reach.rs:270 (tile_reach_module)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2517 (capture)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:2543 (capture)` - `feature::ProgramScopeBinding`: `crates/metal2vulkan-air/src/abi/module.rs:77 (decode)`; `crates/metal2vulkan/src/error/mod.rs:267 (from)` - `feature::SeqCstFence`: `crates/metal2vulkan/src/lower/sync/barrier.rs:443 (require_seq_cst)` - `feature::PostDepthCoverage`: `crates/metal2vulkan-runtime/src/families/features.rs:1219 (state)`; `crates/metal2vulkan/src/lower/stage_io/plan.rs:783 (param)` -- `gap::Textures`: `crates/metal2vulkan-runtime/src/blit_texture.rs:163 (check_depth_view)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:1563 (view_usage)`; `crates/metal2vulkan-runtime/src/pipeline/mod.rs:1625 (compile_error)`; `crates/metal2vulkan-runtime/src/texture.rs:1461 (image_error)`; `crates/metal2vulkan-runtime/src/texture.rs:2221 (storage_over_buffer)`; `crates/metal2vulkan-runtime/src/texture.rs:3036 (new_image_starting)`; `crates/metal2vulkan-runtime/src/texture.rs:4078 (image)`; `crates/metal2vulkan-runtime/src/texture.rs:5703 (host_copy)`; `crates/metal2vulkan-runtime/src/texture/surface_two_planes.rs:207 (new_surface_planes_texture)` +- `gap::Textures`: `crates/metal2vulkan-runtime/src/blit_texture.rs:163 (check_depth_view)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:1563 (view_usage)`; `crates/metal2vulkan-runtime/src/pipeline/mod.rs:1625 (compile_error)`; `crates/metal2vulkan-runtime/src/texture.rs:1463 (image_error)`; `crates/metal2vulkan-runtime/src/texture.rs:2230 (storage_over_buffer)`; `crates/metal2vulkan-runtime/src/texture.rs:3050 (new_image_starting)`; `crates/metal2vulkan-runtime/src/texture.rs:4092 (image)`; `crates/metal2vulkan-runtime/src/texture.rs:5723 (host_copy)`; `crates/metal2vulkan-runtime/src/texture/surface_two_planes.rs:207 (new_surface_planes_texture)` - `gap::ResourceHeap`: `crates/metal2vulkan-runtime/src/binding.rs:1982 (descriptor)` -- `gap::SparseHeaps`: `crates/metal2vulkan-runtime/src/sparse/encoder.rs:465 (first_slice)`; `crates/metal2vulkan-runtime/src/texture.rs:1674 (plan_sparse_texture)`; `crates/metal2vulkan-runtime/src/texture.rs:4826 (make_aliasable)` -- `gap::SparseTileMaps`: `crates/metal2vulkan-runtime/src/binding.rs:562 (slot_tile_map)`; `crates/metal2vulkan-runtime/src/sparse/texture.rs:30 (sparse_refusal)`; `crates/metal2vulkan-runtime/src/texture.rs:1707 (plan_sparse_texture)` +- `gap::SparseHeaps`: `crates/metal2vulkan-runtime/src/sparse/encoder.rs:465 (first_slice)`; `crates/metal2vulkan-runtime/src/texture.rs:1683 (plan_sparse_texture)`; `crates/metal2vulkan-runtime/src/texture.rs:4840 (make_aliasable)` +- `gap::SparseTileMaps`: `crates/metal2vulkan-runtime/src/binding.rs:562 (slot_tile_map)`; `crates/metal2vulkan-runtime/src/sparse/texture.rs:30 (sparse_refusal)`; `crates/metal2vulkan-runtime/src/texture.rs:1716 (plan_sparse_texture)` - `gap::HeapPastMaxBufferSize`: `crates/metal2vulkan-runtime/src/heap.rs:714 (heap_size)` -- `gap::HeapTextureAlignment`: `crates/metal2vulkan-runtime/src/texture/heap.rs:1071 (check_heap_base)` -- `gap::HeapTextureMemory`: `crates/metal2vulkan-runtime/src/texture/heap.rs:1510 (heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1517 (heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2059 (host_heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2291 (memory_shadow)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:554 (memory_refusal)` +- `gap::HeapTextureAlignment`: `crates/metal2vulkan-runtime/src/texture/heap.rs:1073 (check_heap_base)` +- `gap::HeapTextureMemory`: `crates/metal2vulkan-runtime/src/texture/heap.rs:1512 (heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1519 (heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2061 (host_heap_plan)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2293 (memory_shadow)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:556 (memory_refusal)` - `gap::FunctionTablePastMaxBufferLength`: `crates/metal2vulkan-runtime/src/function_table.rs:622 (past_limit)` -- `gap::IndirectCommandBufferPastMaxBufferLength`: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:522 (new_indirect_command_buffer)` -- `gap::IndirectRenderCommands`: `crates/metal2vulkan-runtime/src/compute.rs:1291 (execute_range)`; `crates/metal2vulkan-runtime/src/compute.rs:1376 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/depth_stencil.rs:85 (gpu_resource_id)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:4368 (render_state)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:517 (new_indirect_command_buffer)`; `crates/metal2vulkan-runtime/src/pipeline/mod.rs:1632 (compile_error)`; `crates/metal2vulkan-runtime/src/render.rs:7196 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7681 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8098 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8605 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/executions.rs:1106 (back_memoryless)`; `crates/metal2vulkan-runtime/src/render/executions.rs:2916 (record_forms)`; `crates/metal2vulkan-runtime/src/render/executions.rs:382 (execute_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:441 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:456 (execute_indirect_range)` -- `gap::IndirectImageblockSize`: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3363 (set_imageblock_size)` +- `gap::IndirectCommandBufferPastMaxBufferLength`: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:523 (new_indirect_command_buffer)` +- `gap::IndirectRenderCommands`: `crates/metal2vulkan-runtime/src/compute.rs:1291 (execute_range)`; `crates/metal2vulkan-runtime/src/compute.rs:1376 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/depth_stencil.rs:85 (gpu_resource_id)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:4422 (render_state)`; `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:518 (new_indirect_command_buffer)`; `crates/metal2vulkan-runtime/src/pipeline/mod.rs:1632 (compile_error)`; `crates/metal2vulkan-runtime/src/render.rs:7199 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7734 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8191 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:8741 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/executions.rs:1126 (back_memoryless)`; `crates/metal2vulkan-runtime/src/render/executions.rs:2941 (record_forms)`; `crates/metal2vulkan-runtime/src/render/executions.rs:393 (execute_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:461 (execute_indirect_range)`; `crates/metal2vulkan-runtime/src/render/executions.rs:476 (execute_indirect_range)` +- `gap::IndirectImageblockSize`: `crates/metal2vulkan-runtime/src/indirect_command_buffer.rs:3397 (set_imageblock_size)` - `gap::CommandReplay`: `crates/metal2vulkan-runtime/src/binding.rs:723 (bind_into)`; `crates/metal2vulkan-runtime/src/binding.rs:726 (bind_into)` - `gap::RenderAttachments`: `crates/metal2vulkan-runtime/src/binding.rs:1794 (unexpected)` - `gap::AccelerationStructures`: `crates/metal2vulkan-runtime/src/binding.rs:1797 (unexpected)` -- `gap::FeatureEnable`: `crates/metal2vulkan-runtime/src/enables.rs:1165 (of)` -- `gap::ExtensionEnable`: `crates/metal2vulkan-runtime/src/enables.rs:1156 (of)` -- `gap::Render`: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:404 (stand_in_as)`; `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:460 (stand_in_as)`; `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:684 (check_copies)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:796 (attachment_twin)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:283 (check_sizes)`; `crates/metal2vulkan-runtime/src/kept_bytes.rs:138 (settle)`; `crates/metal2vulkan-runtime/src/linear_attachment.rs:293 (settle)`; `crates/metal2vulkan-runtime/src/nan_clear.rs:204 (plan)`; `crates/metal2vulkan-runtime/src/pipeline/render.rs:1169 (imageblock_sample_length)`; `crates/metal2vulkan-runtime/src/render.rs:2223 (check_pipeline)`; `crates/metal2vulkan-runtime/src/render.rs:5940 (next_instance)`; `crates/metal2vulkan-runtime/src/render.rs:7775 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:516 (scratch)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1313 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1676 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1730 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1791 (attachment_format)`; `crates/metal2vulkan-runtime/src/render_pass.rs:2024 (depth_stencil)`; `crates/metal2vulkan-runtime/src/resolve.rs:1035 (attach)`; `crates/metal2vulkan-runtime/src/resolve.rs:1103 (color_copy)`; `crates/metal2vulkan-runtime/src/resolve.rs:1150 (destination)`; `crates/metal2vulkan-runtime/src/resolve.rs:1167 (destination)`; `crates/metal2vulkan-runtime/src/resolve.rs:1232 (destination)` +- `gap::FeatureEnable`: `crates/metal2vulkan-runtime/src/enables.rs:1166 (of)` +- `gap::ExtensionEnable`: `crates/metal2vulkan-runtime/src/enables.rs:1157 (of)` +- `gap::Render`: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:404 (stand_in_as)`; `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:460 (stand_in_as)`; `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:684 (check_copies)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:796 (attachment_twin)`; `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:283 (check_sizes)`; `crates/metal2vulkan-runtime/src/kept_bytes.rs:138 (settle)`; `crates/metal2vulkan-runtime/src/linear_attachment.rs:293 (settle)`; `crates/metal2vulkan-runtime/src/nan_clear.rs:204 (plan)`; `crates/metal2vulkan-runtime/src/pipeline/render.rs:1169 (imageblock_sample_length)`; `crates/metal2vulkan-runtime/src/render.rs:2226 (check_pipeline)`; `crates/metal2vulkan-runtime/src/render.rs:5943 (next_instance)`; `crates/metal2vulkan-runtime/src/render.rs:7828 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:516 (scratch)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1313 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1676 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1730 (target)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1791 (attachment_format)`; `crates/metal2vulkan-runtime/src/render_pass.rs:2024 (depth_stencil)`; `crates/metal2vulkan-runtime/src/resolve.rs:1035 (attach)`; `crates/metal2vulkan-runtime/src/resolve.rs:1103 (color_copy)`; `crates/metal2vulkan-runtime/src/resolve.rs:1150 (destination)`; `crates/metal2vulkan-runtime/src/resolve.rs:1167 (destination)`; `crates/metal2vulkan-runtime/src/resolve.rs:1232 (destination)` - `gap::TexelsPastBufferLength`: `crates/metal2vulkan-runtime/src/buffer_texture.rs:261 (refusal_error)`; `crates/metal2vulkan-runtime/src/texture/surface_depth.rs:105 (surface_depth_twin)` - `gap::OverlappingSurfaceRows`: `crates/metal2vulkan-runtime/src/buffer_texture.rs:263 (refusal_error)` - `gap::SamplePositionsAtBegin`: `crates/metal2vulkan-runtime/src/depth_stencil_scratch.rs:145 (stencil_scratch)`; `crates/metal2vulkan-runtime/src/render_pass.rs:1861 (positioned_stand_in)`; `crates/metal2vulkan-runtime/src/sample_positions.rs:185 (grid)` @@ -444,12 +443,12 @@ Each refusal's sites, with the function that builds it. - `gap::ViewportDepthRange`: `crates/metal2vulkan-runtime/src/render/draw_shape.rs:341 (settings)`; `crates/metal2vulkan-runtime/src/render_state.rs:1039`; `crates/metal2vulkan-runtime/src/render_state.rs:1208 (depth_ranges_refused)`; `crates/metal2vulkan-runtime/src/render_state.rs:1575 (bias_holds)`; `crates/metal2vulkan-runtime/src/render_state.rs:1594 (collapses)`; `crates/metal2vulkan-runtime/src/render_state.rs:527 (depth_range)`; `crates/metal2vulkan-runtime/src/render_state.rs:755 (compensation)` - `gap::NonFiniteDepthBias`: `crates/metal2vulkan-runtime/src/render_state.rs:1603 (collapses)`; `crates/metal2vulkan-runtime/src/render_state.rs:1606 (collapses)`; `crates/metal2vulkan-runtime/src/render_state.rs:365 (set_depth_bias)`; `crates/metal2vulkan-runtime/src/render_state.rs:463 (draw_viewports)`; `crates/metal2vulkan-runtime/src/render_state.rs:605 (compensation)` - `gap::DepthNeverWithoutAttachment`: `crates/metal2vulkan-runtime/src/depth_stencil.rs:147 (failing_draw)` -- `gap::HiddenDepthStencil`: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:563 (hidden)`; `crates/metal2vulkan-runtime/src/render.rs:6617 (hidden_depth_stencil)` -- `gap::IndirectDrawArguments`: `crates/metal2vulkan-runtime/src/index_bounds.rs:91 (new)`; `crates/metal2vulkan-runtime/src/render.rs:3302 (draw_indexed_primitives_indirect)`; `crates/metal2vulkan-runtime/src/render.rs:7516 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7585 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7616 (draw_resident)` +- `gap::HiddenDepthStencil`: `crates/metal2vulkan-runtime/src/attachment_stand_in.rs:563 (hidden)`; `crates/metal2vulkan-runtime/src/render.rs:6620 (hidden_depth_stencil)` +- `gap::IndirectDrawArguments`: `crates/metal2vulkan-runtime/src/index_bounds.rs:91 (new)`; `crates/metal2vulkan-runtime/src/render.rs:3305 (draw_indexed_primitives_indirect)`; `crates/metal2vulkan-runtime/src/render.rs:7524 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7638 (draw_resident)`; `crates/metal2vulkan-runtime/src/render.rs:7669 (draw_resident)` - `gap::DepthStencilResolve`: `crates/metal2vulkan-runtime/src/depth_stencil_resolve.rs:441 (draws_run)`; `crates/metal2vulkan-runtime/src/resolve.rs:1388 (plan)`; `crates/metal2vulkan-runtime/src/resolve.rs:787 (depth_stencil)`; `crates/metal2vulkan-runtime/src/resolve.rs:885 (steps)`; `crates/metal2vulkan-runtime/src/resolve.rs:905 (steps)`; `crates/metal2vulkan-runtime/src/resolve.rs:946 (split_steps)`; `crates/metal2vulkan-runtime/src/resolve.rs:958 (split_steps)` - `gap::TileAtSampleCount`: `crates/metal2vulkan-runtime/src/render_pass.rs:1611 (layout)`; `crates/metal2vulkan-runtime/src/render_pass.rs:937` -- `gap::ImageblockMasters`: `crates/metal2vulkan-runtime/src/render.rs:7350 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:929 (dispatch_tiles_resident)` -- `gap::TileAndFragmentImageblocks`: `crates/metal2vulkan-runtime/src/render.rs:7342 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:796 (dispatch_tiles_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:921 (dispatch_tiles_resident)` +- `gap::ImageblockMasters`: `crates/metal2vulkan-runtime/src/render.rs:7353 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:929 (dispatch_tiles_resident)` +- `gap::TileAndFragmentImageblocks`: `crates/metal2vulkan-runtime/src/render.rs:7345 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:796 (dispatch_tiles_resident)`; `crates/metal2vulkan-runtime/src/render/tile_dispatch.rs:921 (dispatch_tiles_resident)` - `gap::Metal4Api`: `crates/metal2vulkan-runtime/src/families/features.rs:1487 (state)`; `crates/metal2vulkan-runtime/src/families/limits.rs:1026 (state)`; `crates/metal2vulkan-runtime/src/families/mod.rs:362 (audit)` - `gap::CounterSampleBuffers`: `crates/metal2vulkan-runtime/src/families/limits.rs:1017 (state)` - `gap::ResidencySets`: `crates/metal2vulkan-runtime/src/families/features.rs:1469 (state)`; `crates/metal2vulkan-runtime/src/families/limits.rs:1019 (state)` @@ -461,45 +460,44 @@ Each refusal's sites, with the function that builds it. - `gap::ShaderValidation`: `crates/metal2vulkan-runtime/src/families/features.rs:1467 (state)` - `gap::ShaderLogging`: `crates/metal2vulkan-runtime/src/families/features.rs:1468 (state)` - `gap::DeviceNotifications`: `crates/metal2vulkan-runtime/src/families/features.rs:1472 (state)` -- `gap::RateMapRegions`: `crates/metal2vulkan-runtime/src/rate_mapped_pass.rs:349 (refusal)` +- `gap::RateMapRegions`: `crates/metal2vulkan-runtime/src/rate_mapped_pass.rs:396 (refusal)` - `gap::LayeredPass`: `crates/metal2vulkan-runtime/src/color_resolve.rs:890 (plan)` - `gap::FunctionOptions`: `crates/metal2vulkan-runtime/src/library.rs:215 (new_function_with_descriptor)` - `gap::OverlappingTextureCopies`: `crates/metal2vulkan-runtime/src/blit_texture.rs:1340 (texture_copies_of_bytes)` -- `gap::RebindTextures`: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:637 (rebind_host_pages)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2726 (rebound_heap_images)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2741 (rebound_heap_images)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2752 (rebound_heap_images)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2795 (dma_buf_heap_images_again)` -- `gap::PvrtcBlockOrder`: `crates/metal2vulkan-runtime/src/texture.rs:5775 (host_copy)` -- `gap::DecodedHeapTexture`: `crates/metal2vulkan-runtime/src/texture.rs:1682 (plan_sparse_texture)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1373 (heap_plan)` +- `gap::RebindTextures`: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:637 (rebind_host_pages)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2743 (rebound_heap_images)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2758 (rebound_heap_images)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2769 (rebound_heap_images)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2812 (dma_buf_heap_images_again)` +- `gap::PvrtcBlockOrder`: `crates/metal2vulkan-runtime/src/texture.rs:5795 (host_copy)` +- `gap::DecodedHeapTexture`: `crates/metal2vulkan-runtime/src/texture.rs:1691 (plan_sparse_texture)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:1375 (heap_plan)` - `gap::VertexFetchPast4GiB`: `crates/metal2vulkan-runtime/src/render/vertex_reach.rs:72 (check_vertex_reach)` - `gap::StageInFetchPast4GiB`: `crates/metal2vulkan-runtime/src/fetch_reach.rs:126 (check_stage_in_reach)` - `gap::MappedTextureSampling`: `crates/metal2vulkan-runtime/src/address_map.rs:158 (resolve)` - `gap::LibrarySource`: `crates/metal2vulkan-runtime/src/library.rs:107 (new_library_with_source)` - `gap::RestartedStrip`: `crates/metal2vulkan-runtime/src/render/restart.rs:71 (gap)` -- `gap::PrivatePrimitives`: `crates/metal2vulkan-runtime/src/render.rs:7937 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/restart.rs:72 (gap)` +- `gap::PrivatePrimitives`: `crates/metal2vulkan-runtime/src/render.rs:8029 (draw_resident)`; `crates/metal2vulkan-runtime/src/render/restart.rs:72 (gap)` - `gap::ProvokingVertex`: `crates/metal2vulkan-runtime/src/render/restart.rs:73 (gap)` -- `gap::PrimitiveIdIndices`: `crates/metal2vulkan-runtime/src/render.rs:7947 (draw_resident)` -- `gap::RotatedTexture`: `crates/metal2vulkan-runtime/src/blit_texture.rs:1669 (texel_copies)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:715 (turned_plane)`; `crates/metal2vulkan-runtime/src/rotated.rs:185 (new)`; `crates/metal2vulkan-runtime/src/rotated.rs:201 (new)`; `crates/metal2vulkan-runtime/src/shadow.rs:642 (unmerged)`; `crates/metal2vulkan-runtime/src/texture.rs:5094 (view)`; `crates/metal2vulkan-runtime/src/texture/rotation.rs:100 (check_rotated_reach)`; `crates/metal2vulkan-runtime/src/texture/rotation.rs:322 (copied_image)`; `crates/metal2vulkan-runtime/src/texture/usage_shadow.rs:238 (new_usage_shadow)` -- `gap::DetachTextures`: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:641 (rebind_host_pages)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:622 (make_texture_over)`; `crates/metal2vulkan-runtime/src/detach.rs:172 (detach_host_pages)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2935 (heap_texture_at)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:143 (new_stand_in)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:248 (stand_in_while_detached)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:298 (stand_ins)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:304 (stand_ins)` +- `gap::PrimitiveIdIndices`: `crates/metal2vulkan-runtime/src/render.rs:8039 (draw_resident)` +- `gap::RotatedTexture`: `crates/metal2vulkan-runtime/src/blit_texture.rs:1669 (texel_copies)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:715 (turned_plane)`; `crates/metal2vulkan-runtime/src/rotated.rs:185 (new)`; `crates/metal2vulkan-runtime/src/rotated.rs:201 (new)`; `crates/metal2vulkan-runtime/src/shadow.rs:643 (unmerged)`; `crates/metal2vulkan-runtime/src/texture.rs:5108 (view)`; `crates/metal2vulkan-runtime/src/texture/rotation.rs:100 (check_rotated_reach)`; `crates/metal2vulkan-runtime/src/texture/rotation.rs:322 (copied_image)`; `crates/metal2vulkan-runtime/src/texture/usage_shadow.rs:238 (new_usage_shadow)` +- `gap::DetachTextures`: `crates/metal2vulkan-runtime/src/buffer_descriptor.rs:641 (rebind_host_pages)`; `crates/metal2vulkan-runtime/src/buffer_texture.rs:622 (make_texture_over)`; `crates/metal2vulkan-runtime/src/detach.rs:172 (detach_host_pages)`; `crates/metal2vulkan-runtime/src/texture/heap.rs:2952 (heap_texture_at)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:143 (new_stand_in)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:248 (stand_in_while_detached)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:298 (stand_ins)`; `crates/metal2vulkan-runtime/src/texture/stand_in.rs:304 (stand_ins)` - `gap::TextureBufferLevels`: `crates/metal2vulkan-runtime/src/texture_descriptor.rs:540 (check_made)` - `gap::WriteSwizzle`: `crates/metal2vulkan-runtime/src/texture_descriptor.rs:547 (check_made)` -- `gap::DetachedTexelAccess`: `crates/metal2vulkan-runtime/src/texture.rs:4924 (refuse_detached_texels)` +- `gap::DetachedTexelAccess`: `crates/metal2vulkan-runtime/src/texture.rs:4938 (refuse_detached_texels)` - `gap::SurfaceDepthStencil`: `crates/metal2vulkan-runtime/src/blit_texture.rs:269 (unit)`; `crates/metal2vulkan-runtime/src/texture/surface_depth.rs:57 (surface_depth_twin)` - `gap::ExtendedRangeResolve`: `crates/metal2vulkan-runtime/src/resolve.rs:604 (color)` -- `gap::PredicationDropsUngatedWork`: `crates/metal2vulkan-runtime/src/predication.rs:762 (unbalanced)` - `gap::MultisampledBufferCopy`: `crates/metal2vulkan-runtime/src/blit_texture.rs:536 (copy_from_buffer_to_texture)`; `crates/metal2vulkan-runtime/src/blit_texture.rs:693 (copy_from_texture_to_buffer)` -- `gap::MultisampledBufferLayout`: `crates/metal2vulkan-runtime/src/sample_interleave.rs:1020 (plan)` +- `gap::MultisampledBufferLayout`: `crates/metal2vulkan-runtime/src/sample_interleave.rs:1029 (plan)` - `gap::ColorAttachmentGroups`: `crates/metal2vulkan-runtime/src/render/color_groups.rs:106 (gap)` -- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2372 (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126 (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:52 (set)` +- `apple::ProtectedContent`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs:2414 (commit_now)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:126 (refuse_protected_state_encoder)`; `crates/metal2vulkan-runtime/src/command_buffer/protection.rs:52 (set)` - `apple::LineWidth`: `crates/metal2vulkan-runtime/src/apple_only.rs:189 (check)` - `apple::ViewportTransformDisabled`: `crates/metal2vulkan-runtime/src/apple_only.rs:191 (check)` - `apple::VertexAmplificationMode`: `crates/metal2vulkan-runtime/src/apple_only.rs:195 (check)`; `crates/metal2vulkan-runtime/src/apple_only.rs:320 (set_vertex_amplification_mode)` - `apple::SurfaceClientDirection`: `crates/metal2vulkan-runtime/src/buffer_texture.rs:417 (new_texture_with_iosurface_plane)` -- `bind::DescriptorRangeExceeded`: `crates/metal2vulkan/src/bind/instantiate.rs:653 (bind_buffers)` -- `bind::TexelBufferTooLarge`: `crates/metal2vulkan/src/bind/instantiate.rs:892 (texel_ranges)` +- `bind::DescriptorRangeExceeded`: `crates/metal2vulkan/src/bind/instantiate.rs:655 (bind_buffers)` +- `bind::TexelBufferTooLarge`: `crates/metal2vulkan/src/bind/instantiate.rs:894 (texel_ranges)` - `bind::HeapTooLarge`: `crates/metal2vulkan/src/bind/heap.rs:1014 (new)`; `crates/metal2vulkan/src/bind/heap.rs:1748 (directory_bytes)`; `crates/metal2vulkan/src/bind/heap.rs:1863 (listed_sampler_tables)`; `crates/metal2vulkan/src/bind/heap.rs:1913 (placed)`; `crates/metal2vulkan/src/bind/heap.rs:2069 (heap_elements)`; `crates/metal2vulkan/src/bind/heap.rs:949 (new)`; `crates/metal2vulkan/src/bind/heap.rs:965 (new)` -- `bind::TessellationFactorRange`: `crates/metal2vulkan/src/bind/graphics.rs:3653 (patch_binding)` -- `bind::PatchIndexRange`: `crates/metal2vulkan/src/bind/graphics.rs:3697 (patch_binding)` -- `bind::ControlPointIndexRange`: `crates/metal2vulkan/src/bind/graphics.rs:3735 (patch_binding)` +- `bind::TessellationFactorRange`: `crates/metal2vulkan/src/bind/graphics.rs:3767 (patch_binding)` +- `bind::PatchIndexRange`: `crates/metal2vulkan/src/bind/graphics.rs:3811 (patch_binding)` +- `bind::ControlPointIndexRange`: `crates/metal2vulkan/src/bind/graphics.rs:3849 (patch_binding)` - `bind::MissingStageInRegion`: `crates/metal2vulkan/src/bind/dispatch.rs:796 (instantiate)` -- `bind::UniformViewAliased`: `crates/metal2vulkan/src/bind/instantiate.rs:607 (check_uniform_aliasing)` +- `bind::UniformViewAliased`: `crates/metal2vulkan/src/bind/instantiate.rs:609 (check_uniform_aliasing)` - `bind::MissingDeviceAddress`: `crates/metal2vulkan/src/bind/plan/slots.rs:133 (plan_buffer)` - `limit::InlinedInstructions`: `crates/metal2vulkan-air/src/canon/inline.rs:330 (u32_of)`; `crates/metal2vulkan-air/src/canon/inline.rs:334 (usize_of)`; `crates/metal2vulkan-air/src/canon/inline.rs:61 (inline)` - `limit::OutputBlocks`: `crates/metal2vulkan/src/structurize/irreducible.rs:90 (round)`; `crates/metal2vulkan/src/structurize/mod.rs:187 (structure_prepared)`; `crates/metal2vulkan/src/structurize/structurizer_properties/mod.rs:423 (output_cap_is_checked_before_allocating)`; `crates/metal2vulkan/src/structurize/structurizer_properties/trees.rs:232 (the_output_cap_is_checked_before_emission)` @@ -515,10 +513,10 @@ Each refusal's sites, with the function that builds it. - `limit::ConstructNesting`: `crates/metal2vulkan/src/structurize/emit.rs:216 (check_tree)`; `crates/metal2vulkan/src/structurize/emit/predicate.rs:151 (facts)` - `limit::PrivateArenaBytes`: `crates/metal2vulkan/src/lower/access/local.rs:650 (use_arena)`; `crates/metal2vulkan/src/memory/plan.rs:1880 (place_allocas)`; `crates/metal2vulkan/src/memory/plan.rs:1887 (place_allocas)` - `limit::CallStackBytes`: `crates/metal2vulkan-air/src/canon/recursion.rs:118 (metal_stack)` -- `ratemap::ScreenExtent`: `crates/metal2vulkan/src/bind/rate_map.rs:501 (new)` -- `ratemap::LayerCount`: `crates/metal2vulkan/src/bind/rate_map.rs:505 (new)` -- `ratemap::DenseSamples`: `crates/metal2vulkan/src/bind/rate_map.rs:516 (new)` -- `ratemap::SampleOutOfRange`: `crates/metal2vulkan/src/bind/rate_map.rs:524 (new)` -- `ratemap::SampleCount`: `crates/metal2vulkan/src/bind/rate_map.rs:532 (new)` +- `ratemap::ScreenExtent`: `crates/metal2vulkan-runtime/src/rate_map.rs:431 (compile_over)`; `crates/metal2vulkan/src/bind/rate_map.rs:524 (new)` +- `ratemap::LayerCount`: `crates/metal2vulkan/src/bind/rate_map.rs:528 (new)` +- `ratemap::DenseSamples`: `crates/metal2vulkan/src/bind/rate_map.rs:539 (new)` +- `ratemap::SampleOutOfRange`: `crates/metal2vulkan/src/bind/rate_map.rs:547 (new)` +- `ratemap::SampleCount`: `crates/metal2vulkan/src/bind/rate_map.rs:555 (new)` - `budget::Time`: `crates/metal2vulkan-air/src/budget/mod.rs:275 (tick)` diff --git a/docs/RUNTIME-PORTING.md b/docs/RUNTIME-PORTING.md index 3395885d9..4cc1d314d 100644 --- a/docs/RUNTIME-PORTING.md +++ b/docs/RUNTIME-PORTING.md @@ -345,8 +345,10 @@ narrow refusal that the call's rustdoc describes. |---|---|---| | `copy_parameter_data` | `copyParameterDataToBuffer:offset:` | `RasterizationRateMap::copy_parameter_data_to_buffer` | | `layer_count` | `layerCount` | `RasterizationRateMap::layer_count` | -| `physical_to_screen` | `mapPhysicalToScreenCoordinates:forLayer:` | `RasterizationRateMap::map_physical_to_screen_coordinates` | -| `screen_to_physical` | `mapScreenToPhysicalCoordinates:forLayer:` | `RasterizationRateMap::map_screen_to_physical_coordinates` | +| `mutability` | `mutability` (SPI) | `RasterizationRateMap::mutability` | +| `physical_to_screen` | `mapPhysicalToScreenCoordinates:forLayer:` | `RasterizationRateMap::map_physical_to_screen_coordinates`; a map of no layers, and a mutable map not yet reset, are refused (Metal's process ends) | +| `reset` | `resetUsingDescriptor:` (SPI) | `RasterizationRateMap::reset_using_descriptor`; a pass not yet submitted draws by the map as reset | +| `screen_to_physical` | `mapScreenToPhysicalCoordinates:forLayer:` | `RasterizationRateMap::map_screen_to_physical_coordinates`; a map of no layers is refused (Metal's process ends) | | `parameter_buffer_size_and_align` | `parameterBufferSizeAndAlign` | `RasterizationRateMap::parameter_buffer_size_and_align` | | `physical_granularity` | `physicalGranularity` | `RasterizationRateMap::physical_granularity` | | `physical_size` | `physicalSizeForLayer:` | `RasterizationRateMap::physical_size_for_layer` | @@ -356,6 +358,7 @@ narrow refusal that the call's rustdoc describes. | Item | Metal | Runtime | |---|---|---| | `set_layer` | `setLayer:atIndex:` | field `metal2vulkan::bind::RateMapDescriptor::layers` | +| `set_mutability` | `setMutability:` (SPI) | field `metal2vulkan::bind::RateMapDescriptor::mutability` | | `layer_count` | `layerCount` | `layers.len()` | | `layer` | | `layers[i]` | @@ -578,7 +581,6 @@ These items have no single runtime call. The consumer builds them from the calls | Item | How | |---|---| | `BlitCmd::CopyTextureRegionOptions` | options 0 is `BlitCommandEncoder::copy_from_texture_to_texture`; a public `BlitOption` goes through a buffer (`copy_from_texture_to_buffer`, then `copy_from_buffer_to_texture`) | -| `RateMap::reset` | a new map: `Device::new_rasterization_rate_map` | | `RenderCmd::SetDepthClipModeSpi` | the public `RenderCommandEncoder::set_depth_clip_mode` | | `RenderCmd::SetPrimitiveRestartEnabled` | `RenderCommandEncoder::set_primitive_restart_enabled`: indexed strips restart at the index as Metal takes it for their index type, and only there | | `GpuDevice::allow_foreign_libraries` | nothing to call: `Device::new_library_with_data` reads a metallib of any Apple platform | @@ -607,6 +609,5 @@ what only a paravirtualized device needs belongs to its consumer. - **Apple's serialized pipeline descriptors:** the three `deserialize_*_pipeline_descriptor` items. - **Apple's descriptions of formats and devices:** `GpuDevice::pixel_format_info` (Apple's flag - words; `metal2vulkan::metal::format` holds the block facts), `DeviceCaps::gpu_core_count`, the - private limits and flags no measurement covers, and - `RateMap::mutability`, which only Apple's private headers declare. + words; `metal2vulkan::metal::format` holds the block facts), `DeviceCaps::gpu_core_count`, and + the private limits and flags no measurement covers.