From 66c344998a67a12ec08178ef577e2147e6fc4252 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sun, 8 Nov 2026 23:48:20 -0800 Subject: [PATCH] resolve_rounding: the cleared resolve reads the device's announcement of the conversion once a device um870 job m3-max-11101 (780M, 2 runs) passed RGBA8Unorm_sRGB under 9e985f4bb4: its passes announced DeviceColorConversion, and every resolved texel ([bc, 7f, 0a, ff]) lies on the codes nearest the clear. BGRA8Unorm_sRGB still failed: its 1x clear stores [0a, 80, bc, 80], its 4x clear resolves to [0a, 7f, bc, 80], and its passes announced nothing. A device announces each kind once (Device::degrade, AnnouncedKinds::now), and the RGBA format's passes had already announced it. The lane now reads the kinds the device has announced so far (Messages::taken_kinds), not only these passes' notices. (cherry picked from commit c4ad2a0905acba67636dac3e908005f1a380e07c) --- .../src/runtime_lane/resolve_rounding.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/metal2vulkan-validation/src/runtime_lane/resolve_rounding.rs b/crates/metal2vulkan-validation/src/runtime_lane/resolve_rounding.rs index 72d5f4f67..3da349638 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/resolve_rounding.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/resolve_rounding.rs @@ -1363,8 +1363,9 @@ fn a_maps_form_pass_resolves_bgra8_as_announced() { /// it, resolves to the clear's codes: the bytes the device's clear of a 1x texture of the format /// stores (Metal's bytes, `renders.rs`' `COLOR_CLEARS`, where its conversion is Metal's, printed), /// as every sample holds the clear, which Metal's rule and the device's average give back, -/// whatever form the device keeps the clear in. Where the passes announce -/// `device-color-conversion`, the device converts the clear its own way, which may differ between +/// whatever form the device keeps the clear in. Where the device announced +/// `device-color-conversion` (once a device: these passes' or the earlier format's), the device +/// converts the clear its own way, which may differ between /// its 1x and its 4x images (the Radeon 780M under RADV: a 1x clear of 0.214 stores `0x80`, the 4x /// one resolves to `0x7f`): there each channel of the resolve is one of the two codes nearest the /// clear's value, the sRGB curve's for a colour channel and the value itself for alpha. @@ -1419,8 +1420,9 @@ fn cleared_srgb_attachments_resolve_to_the_clear_s_codes() { messages.take_notices(); clear(&single, None); clear(&msaa, Some(&resolved)); + // A device announces each kind once: an earlier format's clear may have announced it. let notices = super::degrade_notices::counts(&messages.take_notices()); - let converted = notices.contains_key(&Degradation::DeviceColorConversion); + let converted = (messages.taken_kinds()).contains(&Degradation::DeviceColorConversion); // The clear's value in codes, in the texel's byte order: the sRGB curve's for a colour // channel, alpha as it is. let encode = |v: f64| match v <= 0.0031308 {