From 3ef2ca4e11864669352746bf12ec2b9702bc5751 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 9 Nov 2026 00:15:28 -0800 Subject: [PATCH] word_samples_msaa: an own-format sRGB sample's reads allow srgb-texel-decode as a word's do With the RGB9E5Float blends checked as the device's blend (job 11181, PHOENIX: no wrong answers at either count), the lane reached its notice check on RADV for the first time and failed there: announced past [DeviceColorConversion, DeviceRoundedResolve, DeviceDenormals, FastMathRewrites, DeviceTexelConversion, NativeNanEncoding]: [SrgbTexelDecode] RADV holds R8Unorm_sRGB multisampled in its own format. The lane's reads of its samples go through the device's sRGB decode and announce srgb-texel-decode, but the lane allowed that notice only for a format held as its word. The allowance now covers an sRGB sample held either way, wherever the device's sampler is not Metal's; read() already bounds the decode alike for both. (cherry picked from commit acc53ee20437d7532c109e9c26de374174098e9b) --- .../src/runtime_lane/word_samples_msaa.rs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/crates/metal2vulkan-validation/src/runtime_lane/word_samples_msaa.rs b/crates/metal2vulkan-validation/src/runtime_lane/word_samples_msaa.rs index 2cd9ad827..7165329f4 100644 --- a/crates/metal2vulkan-validation/src/runtime_lane/word_samples_msaa.rs +++ b/crates/metal2vulkan-validation/src/runtime_lane/word_samples_msaa.rs @@ -15,9 +15,10 @@ //! attachments (`DeviceOptions::withheld_attachment_formats`), which holds each multisampled //! texture the device renders in its word's format (`image_plan::word_samples`) where the device //! renders the word at the count. Each leg prints which way it held each format. A word's samples -//! are Metal's words, read as Metal reads them (an sRGB word's by the device's decode, -//! `srgb-texel-decode`, within a code of the transfer where it is not Metal's, and a 5- or 6-bit -//! field's by the device's widening, `device-texel-conversion`, within its bound there: [`read`]), +//! are Metal's words, read as Metal reads them (an sRGB sample's, a word's or the format's own, by +//! the device's decode, `srgb-texel-decode`, within a code of the transfer where it is not +//! Metal's, and a 5- or 6-bit field's by the device's widening, `device-texel-conversion`, within +//! its bound there: [`read`]), //! and its //! resolve, the crate-owned one, is Metal's //! for `R8Unorm_sRGB` and `RGB9E5Float` and within one code of each field of Metal's for the @@ -1064,6 +1065,15 @@ fn multisampled_word_formats_store_read_resolve_and_blend_as_metal() { if !lane.metal_sampler() { allowed.insert(Degradation::DeviceTexelConversion); } + // An sRGB sample's reads, the device's decode where it is not Metal's: a word's and a + // format's own alike (RADV holds `R8Unorm_sRGB` in its own format). + let srgb = matches!( + WordAttachment::layout(pf), + Some(WordAttachment::Srgb8 { .. }) + ); + if srgb && !lane.metal_sampler() { + allowed.insert(Degradation::SrgbTexelDecode); + } match word { true => { kinds.insert(Degradation::ShaderResolve); @@ -1077,14 +1087,6 @@ fn multisampled_word_formats_store_read_resolve_and_blend_as_metal() { if blended { allowed.insert(Degradation::SamplePlanes); } - // An sRGB word's reads, the device's decode where it is not Metal's. - let srgb = matches!( - WordAttachment::layout(pf), - Some(WordAttachment::Srgb8 { .. }) - ); - if srgb && !lane.metal_sampler() { - allowed.insert(Degradation::SrgbTexelDecode); - } } false => { allowed.extend(resolve_kind(&lane.device, samples));