From e24fdb3a9d5e4251aa31a7bb300fe7b2bce801bc Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 15 Dec 2025 13:11:00 -0800 Subject: [PATCH] Workaround for harmless warning about descriptor sets (#9519) * Workaround for harmless warning about descriptor sets The proper fix is difficult and will be handled later. Here we simply suppress the warning at FL0. BUGS=[468072646] * Apply suggestions from code review --- filament/src/ds/DescriptorSet.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/filament/src/ds/DescriptorSet.cpp b/filament/src/ds/DescriptorSet.cpp index ae138a547b..9ef06ea836 100644 --- a/filament/src/ds/DescriptorSet.cpp +++ b/filament/src/ds/DescriptorSet.cpp @@ -106,13 +106,22 @@ void DescriptorSet::commitSlow(DescriptorSetLayout const& layout, } }); - auto const unsetValidDescriptors = layout.getValidDescriptors() & ~mValid; - if (UTILS_VERY_UNLIKELY(!unsetValidDescriptors.empty() && !mSetUndefinedParameterWarning)) { - unsetValidDescriptors.forEachSetBit([&](auto i) { - LOG(WARNING) << (layout.isSampler(i) ? "Sampler" : "Buffer") << " descriptor " << i - << " of " << mName.c_str() << " is not set. Please report this issue."; - }); - mSetUndefinedParameterWarning = true; + // FIXME: see [b/468072646] + // We only validate empty descriptors at FEATURE_LEVEL_1 and above. + // This is because at FL0 it's expected that some descriptor won't be set. In theory, the + // corresponding layouts should not even contain those descriptors. However, making that change + // is difficult and risky, and will be done at a later time. + // Note: that the correct fix is actually needed to properly support FL3 once we want + // to take advantage of having more samplers. + if (UTILS_LIKELY(driver.getFeatureLevel() > backend::FeatureLevel::FEATURE_LEVEL_0)) { + auto const unsetValidDescriptors = layout.getValidDescriptors() & ~mValid; + if (UTILS_VERY_UNLIKELY(!unsetValidDescriptors.empty() && !mSetUndefinedParameterWarning)) { + unsetValidDescriptors.forEachSetBit([&](auto i) { + LOG(WARNING) << (layout.isSampler(i) ? "Sampler" : "Buffer") << " descriptor " << i + << " of " << mName.c_str() << " is not set. Please report this issue."; + }); + mSetUndefinedParameterWarning = true; + } } }