From 1746ba09275e7fbfa0e317ee98fee2fe1ad4c0da Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 19:53:28 -0800 Subject: [PATCH] sample_coverage: the early-mask kind's lane site, PAST_EARLY_MASKS tests::degradation_sites failed in the suites of m3-max-10560: VisibilityPastEarlyMask was named by no lane site. The sample coverage lane, whose early-tests draws take it on a device without earlyFragmentMultisampleCoverageAfterSampleCounting, now declares it as a site const, which degrade_notices lists and documents. (cherry picked from commit 3d6d90ef6054cf5fa1ea6f2eaafc7be53f0d6966) --- .../src/runtime_lane/degrade_notices.rs | 6 +++++- .../src/runtime_lane/sample_coverage.rs | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs b/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs index d7f120cd8..9f6e10e81 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/degrade_notices.rs @@ -117,7 +117,9 @@ //! together on a driver that merges submissions in `grouped_submissions` ([`GROUPED`]), //! visibility //! counts of draws writing several colors on a driver that counts each sample once per color in -//! `color_groups` ([`PER_COLOR_COUNTS`]), passes that load and draw a signed normalized attachment +//! `color_groups` ([`PER_COLOR_COUNTS`]), visibility counts of early-tests draws whose fragment +//! function writes its sample mask on a device that may count after it in `sample_coverage` +//! ([`PAST_EARLY_MASKS`]), passes that load and draw a signed normalized attachment //! holding a minimum code, or an `RGB9E5Float` one holding an unnormalized word, in //! `snorm_tile_store` ([`SNORM_MINIMUM`], [`SHARED_EXPONENT`]), condition words of command //! predication past their buffer that read memory unrelated to it in `predication` @@ -210,6 +212,7 @@ use super::resource_ids::{ }; use super::rotated_textures::ROTATED_LOADS; use super::sample_copies::DRAWN_DEPTH; +use super::sample_coverage::PAST_EARLY_MASKS; use super::shader_stencil::SHADOW; use super::snorm_tile_store::{SHARED_EXPONENT, SNORM_MINIMUM}; use super::sparse_textures::SPARSE; @@ -547,6 +550,7 @@ fn every_kind_has_a_site_a_lane_test_takes() { &OWN_COPIES, &KEPT_COLORS, &PER_COLOR_COUNTS, + &PAST_EARLY_MASKS, &DRAWN_DEPTH, &USAGE_SHADOWS, &HEAP_PLANES, diff --git a/crates/metal2vulkan-validation/src/runtime_lane/sample_coverage.rs b/crates/metal2vulkan-validation/src/runtime_lane/sample_coverage.rs index b65ca5809..8863d86cd 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/sample_coverage.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/sample_coverage.rs @@ -43,6 +43,10 @@ use metal2vulkan_runtime::{ TextureDescriptor, Viewport, VisibilityResultMode, }; +/// The kind the early-tests draws of [`the_sample_coverage_applies_after_the_fragment_function`] +/// take on a device that does not state `earlyFragmentMultisampleCoverageAfterSampleCounting`. +pub(super) const PAST_EARLY_MASKS: [Degradation; 1] = [Degradation::VisibilityPastEarlyMask]; + /// The target's side. const SIDE: u64 = 16; @@ -455,9 +459,10 @@ fn the_sample_coverage_applies_after_the_fragment_function() { ); // One sample is never refused: its three draws. assert!(drawn >= 3, "{name}: {drawn} draws"); + let [past_mask] = PAST_EARLY_MASKS; let announced = (messages.take_notices().iter()) .filter_map(|m| m.degradation.as_ref()) - .any(|n| n.degradation == Degradation::VisibilityPastEarlyMask); + .any(|n| n.degradation == past_mask); assert_eq!( announced, !counts_after, "{name}: visibility-past-early-mask announced"