diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-07-19 10:29:36 +0100 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-07-22 05:56:51 +0100 |
commit | 1bb43d7be48813ba318bc2613d020dc8a3b71746 (patch) | |
tree | 21e7ef9ad229b1338c6172355ee80f6d062a2bb9 /src/render | |
parent | 0e250e9e943daf88df09f1ad1bd11a46e1084da0 (diff) |
Silence warnings about null textures in uniforms
It's common while textures are loading
Change-Id: I360c88c72fbd0a034aff07451fd49be17b348d40
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/backend/uniform.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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<float>(), mat33.constData(), 9 * sizeof(float)); break; } + if (variant.userType() == qMetaTypeId<Qt3DRender::QAbstractTexture *>()) { + // silently ignore null texture pointers as they are common while textures are loading + if (variant.value<Qt3DRender::QAbstractTexture *>() == nullptr) + break; + } qWarning() << "Unknown uniform type or value:" << variant << "Please check your QParameters"; } } |