diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs index bf51122d1..d16443ad2 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_gamut.rs @@ -337,13 +337,16 @@ impl Case for GamutDraw { /// `MultisampleResolve`, and the depth and stencil stored `DontCare`, on a driver measured to /// keep one of Metal's answers), and on a device without multisampled storage images /// `sample-planes` and `fetch-through-scratch` (the interlocked blend reads and writes the - /// samples as planes, through a scratch image the target's usage needs). None loosens a code: - /// every texel still compares exactly. + /// samples as planes, through a scratch image the target's usage needs). And + /// `render-pass-split` (`crate::replay::interlocked_split_notice`): the second draw blends in + /// the pixel interlock over what the first wrote there. None loosens a code: every texel still + /// compares exactly. fn allowances(&self) -> Vec { let mut named = notices(&self.format); named.push(crate::replay::notice_allowance( Degradation::ExtendedRangeBlendsStoredCodes.code(), )); + named.push(crate::replay::interlocked_split_notice()); if self.samples > 1 { named.extend( [ @@ -787,7 +790,9 @@ impl Case for MaskedDraw { /// Beside the family's notices, for the blended write, `extended-range-blends-stored-codes`: /// it blends over the codes the first draw stored on a device whose passes hold no `half` /// shadow (`framebuffer_fetch::holds_extended_shadows`); on lavapipe the shadow is held beside - /// the input attachment. It loosens no code. + /// the input attachment. And `render-pass-split` (`crate::replay::interlocked_split_notice`): + /// a blended write, and a masked one into `BGR10_XR`'s shared word, reads and writes in the + /// pixel interlock what the first draw wrote there. It loosens no code. fn allowances(&self) -> Vec { let mut named = notices(&self.format); if self.blend.is_some() { @@ -795,6 +800,13 @@ impl Case for MaskedDraw { Degradation::ExtendedRangeBlendsStoredCodes.code(), )); } + let shared_word = matches!( + self.format.format, + PixelFormat::BGR10XR | PixelFormat::BGR10XRSRGB + ); + if self.blend.is_some() || shared_word { + named.push(crate::replay::interlocked_split_notice()); + } named } diff --git a/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs b/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs index 093ec000f..e34ff84c4 100644 --- a/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs +++ b/crates/metal2vulkan-conformance/src/cases/extended_range_gradients.rs @@ -253,7 +253,9 @@ impl Case for GradientDraw { /// codes), `dont-care-store` (the multisampled attachment of `MultisampleResolve`, on a driver /// measured to keep one of Metal's answers), and on a device without multisampled storage /// images `sample-planes` and `fetch-through-scratch` (the interlocked blend reads and writes - /// the samples as planes, through a scratch image the target's usage needs). + /// the samples as planes, through a scratch image the target's usage needs). A blended row also + /// declares `render-pass-split` (`crate::replay::interlocked_split_notice`): its second draw + /// blends in the pixel interlock over what the first wrote there. fn allowances(&self) -> Vec { let mut named = vec![crate::replay::shared_memory_notice()]; named.extend(super::compressed_blits::kept_encoding_notice( @@ -280,6 +282,9 @@ impl Case for GradientDraw { .into_iter() .map(|kind| crate::replay::notice_allowance(kind.code())), ); + if self.blended { + named.push(crate::replay::interlocked_split_notice()); + } named } diff --git a/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs b/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs index 105442034..6a677a75b 100644 --- a/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs +++ b/crates/metal2vulkan-conformance/src/cases/fetch_ordered.rs @@ -231,10 +231,15 @@ impl Case for FetchOrdered { // nothing else (replay-nvidia.log). On MoltenVK, where // the chip's GPU shares the CPU's memory, it cannot fire at all, which is why no // recording of this suite declares it. + // + // Every row fetches in the pixel interlock draw after draw, so on a driver whose such draws + // race under load each draw after the first begins a render pass instance of its own + // (`crate::replay::interlocked_split_notice` holds the reason and the run it rests on). std::iter::once(crate::replay::shared_memory_notice()) - .chain([crate::replay::notice_allowance( - Degradation::FetchThroughScratch.code(), - )]) + .chain([ + crate::replay::notice_allowance(Degradation::FetchThroughScratch.code()), + crate::replay::interlocked_split_notice(), + ]) .collect() } diff --git a/crates/metal2vulkan-conformance/src/replay.rs b/crates/metal2vulkan-conformance/src/replay.rs index 121dbb16d..a16c1abb9 100644 --- a/crates/metal2vulkan-conformance/src/replay.rs +++ b/crates/metal2vulkan-conformance/src/replay.rs @@ -364,6 +364,26 @@ pub fn shared_memory_notice() -> crate::allowance::Allowance { notice_allowance(metal2vulkan_runtime::Degradation::SharedInSystemMemory.code()) } +/// The declaration a case needs for the split a **venue's driver** makes the runtime take between +/// two draws that read and write a color in the pixel interlock: `render-pass-split`, which the +/// runtime announces where a draw that reaches interlocked storage an earlier draw of its +/// instance wrote begins a render pass instance of its own, on a driver whose such draws race +/// under load (`DriverFact::InterlockedDrawsRaceUnderLoad`: MoltenVK on Apple's GPUs, which +/// encodes no Metal barrier inside a render pass there). +/// +/// **Why it is the venue's and not ours.** Metal runs the case's draws in one pass, ordered by its +/// tile, and records no split; a driver that orders such draws by the interlock or by a barrier +/// inside the instance runs them in one instance too. The split is the runtime ordering them on a +/// driver that does neither, and the notice is it reporting the cost. Like every +/// [`notice_allowance`] it loosens the notices site alone: every value still compares exactly. +/// +/// **Its evidence.** Measured on the M3 Max (MoltenVK 1.4.2, macOS 27.0.1): it fired for every row +/// of `fetch-ordered-*`, `xr-gamut-*`, `xr-masked-*` whose second draw blends or writes a +/// `BGR10_XR` word under a mask, and `xr-gradient-*-blended-*`, the families that name it. +pub fn interlocked_split_notice() -> crate::allowance::Allowance { + notice_allowance(metal2vulkan_runtime::Degradation::RenderPassSplit.code()) +} + /// The slug of `docs/API.md`'s accepted difference that says what a device presenting a Mac that /// keeps no texture compressed answers, as a Mac with an Intel or AMD GPU does /// ([`without_compression`]): "A device answers as the class of Mac it presents".