From 1bb43d7be48813ba318bc2613d020dc8a3b71746 Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Fri, 19 Jul 2019 10:29:36 +0100 Subject: Silence warnings about null textures in uniforms It's common while textures are loading Change-Id: I360c88c72fbd0a034aff07451fd49be17b348d40 Reviewed-by: Paul Lemire --- src/render/backend/uniform.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/render') diff --git a/src/render/backend/uniform.cpp b/src/render/backend/uniform.cpp index 41ee24967..17c26e6c7 100644 --- a/src/render/backend/uniform.cpp +++ b/src/render/backend/uniform.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "uniform_p.h" +#include "qabstracttexture.h" QT_BEGIN_NAMESPACE @@ -261,6 +262,11 @@ UniformValue UniformValue::fromVariant(const QVariant &variant) memcpy(v.data(), mat33.constData(), 9 * sizeof(float)); break; } + if (variant.userType() == qMetaTypeId()) { + // silently ignore null texture pointers as they are common while textures are loading + if (variant.value() == nullptr) + break; + } qWarning() << "Unknown uniform type or value:" << variant << "Please check your QParameters"; } } -- cgit v1.2.3