diff --git a/filament/src/components/RenderableManager.cpp b/filament/src/components/RenderableManager.cpp index 35abe8d947d..8dfd56b449c 100644 --- a/filament/src/components/RenderableManager.cpp +++ b/filament/src/components/RenderableManager.cpp @@ -807,7 +807,10 @@ void FRenderableManager::setMaterialInstanceAt(Instance instance, uint8_t level, primitives[primitiveIndex].setMaterialInstance(mi); AttributeBitset const required = material->getRequiredAttributes(); AttributeBitset const declared = primitives[primitiveIndex].getEnabledAttributes(); - if (UTILS_UNLIKELY((declared & required) != required)) { + // Print the warning only when the handle is available. Otherwise this may end up + // emitting many invalid warnings as the `declared` bitset is not populated yet. + bool const isPrimitiveInitialized = !!primitives[primitiveIndex].getHwHandle(); + if (UTILS_UNLIKELY(isPrimitiveInitialized && (declared & required) != required)) { slog.w << "[instance=" << instance.asValue() << ", primitive @ " << primitiveIndex << "] missing required attributes (" << required << "), declared=" << declared << io::endl;