summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
Diffstat (limited to 'src/render')
-rw-r--r--src/render/backend/managers.cpp2
-rw-r--r--src/render/backend/managers_p.h2
-rw-r--r--src/render/framegraph/qframegraphnode.cpp37
-rw-r--r--src/render/framegraph/qframegraphnode_p.h5
-rw-r--r--src/render/framegraph/qframegraphnodecreatedchange.cpp3
-rw-r--r--src/render/framegraph/qframegraphnodecreatedchange_p.h11
-rw-r--r--src/render/frontend/qrenderaspect.cpp2
-rw-r--r--src/render/io/qsceneloader.cpp2
-rw-r--r--src/render/materialsystem/qgraphicsapifilter_p.h2
-rw-r--r--src/render/materialsystem/shaderbuilder_p.h2
-rw-r--r--src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp2
-rw-r--r--src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp7
-rw-r--r--src/render/renderers/opengl/renderer/renderer.cpp6
-rw-r--r--src/render/renderers/opengl/textures/gltexture.cpp5
14 files changed, 72 insertions, 16 deletions
diff --git a/src/render/backend/managers.cpp b/src/render/backend/managers.cpp
index 6e8c1376d..3b1f8e910 100644
--- a/src/render/backend/managers.cpp
+++ b/src/render/backend/managers.cpp
@@ -88,7 +88,7 @@ void SkeletonManager::addDirtySkeleton(DirtyFlag dirtyFlag, HSkeleton skeletonHa
}
}
-QVector<HSkeleton> SkeletonManager::dirtySkeletons(DirtyFlag dirtyFlag)
+QVector<HSkeleton> SkeletonManager::takeDirtySkeletons(DirtyFlag dirtyFlag)
{
switch (dirtyFlag) {
case SkeletonDataDirty:
diff --git a/src/render/backend/managers_p.h b/src/render/backend/managers_p.h
index 312889a43..b62e2f3e0 100644
--- a/src/render/backend/managers_p.h
+++ b/src/render/backend/managers_p.h
@@ -414,7 +414,7 @@ public:
};
void addDirtySkeleton(DirtyFlag dirtyFlag, HSkeleton skeletonHandle);
- QVector<HSkeleton> dirtySkeletons(DirtyFlag dirtyFlag);
+ QVector<HSkeleton> takeDirtySkeletons(DirtyFlag dirtyFlag);
private:
QVector<HSkeleton> m_dirtyDataSkeletons;
diff --git a/src/render/framegraph/qframegraphnode.cpp b/src/render/framegraph/qframegraphnode.cpp
index 0a60edef7..9acfd1209 100644
--- a/src/render/framegraph/qframegraphnode.cpp
+++ b/src/render/framegraph/qframegraphnode.cpp
@@ -41,6 +41,12 @@
#include "qframegraphnode_p.h"
#include <Qt3DRender/qframegraphnodecreatedchange.h>
+#include <Qt3DCore/QNode>
+
+#include <QQueue>
+
+using namespace Qt3DCore;
+
QT_BEGIN_NAMESPACE
namespace Qt3DRender {
@@ -190,7 +196,10 @@ QFrameGraphNode::~QFrameGraphNode()
}
/*!
- Returns a pointer to the parent.
+ Returns a pointer to the parent frame graph node.
+
+ If the parent of this node is not a frame graph node,
+ this method will recursively look for a parent node that is a frame graph node.
*/
QFrameGraphNode *QFrameGraphNode::parentFrameGraphNode() const
{
@@ -205,6 +214,32 @@ QFrameGraphNode *QFrameGraphNode::parentFrameGraphNode() const
return parentFGNode;
}
+/*!
+ \internal
+ * Returns a list of the children that are frame graph nodes.
+ * If this function encounters a child node that is not a frame graph node,
+ * it will go through the children of the child node and look for frame graph nodes.
+ * If any of these are not frame graph nodes, they will be further searched as
+ * if they were direct children of this node.
+ */
+QVector<QFrameGraphNode *> QFrameGraphNodePrivate::childFrameGraphNodes() const
+{
+ Q_Q(const QFrameGraphNode);
+ QVector<QFrameGraphNode *> result;
+ QQueue<QNode *> queue;
+ queue.append(q->childNodes().toList());
+ result.reserve(queue.size());
+ while (!queue.isEmpty()) {
+ auto *child = queue.dequeue();
+ auto *childFGNode = qobject_cast<QFrameGraphNode *>(child);
+ if (childFGNode != nullptr)
+ result.push_back(childFGNode);
+ else
+ queue.append(child->childNodes().toList());
+ }
+ return result;
+}
+
/*! \internal */
QFrameGraphNode::QFrameGraphNode(QFrameGraphNodePrivate &dd, QNode *parent)
: QNode(dd, parent)
diff --git a/src/render/framegraph/qframegraphnode_p.h b/src/render/framegraph/qframegraphnode_p.h
index 00cc53626..c03017638 100644
--- a/src/render/framegraph/qframegraphnode_p.h
+++ b/src/render/framegraph/qframegraphnode_p.h
@@ -65,9 +65,12 @@ class QFrameGraphNodePrivate : public Qt3DCore::QNodePrivate
{
public:
QFrameGraphNodePrivate();
+ QVector<QFrameGraphNode *> childFrameGraphNodes() const;
+
+ static QFrameGraphNodePrivate *get(QFrameGraphNode *node) { return node->d_func(); }
+ static const QFrameGraphNodePrivate *get(const QFrameGraphNode *node) { return node->d_func(); }
Q_DECLARE_PUBLIC(QFrameGraphNode)
- QList<QFrameGraphNode *> m_fgChildren;
};
} // namespace Qt3DRender
diff --git a/src/render/framegraph/qframegraphnodecreatedchange.cpp b/src/render/framegraph/qframegraphnodecreatedchange.cpp
index ef51d5228..464c98bc3 100644
--- a/src/render/framegraph/qframegraphnodecreatedchange.cpp
+++ b/src/render/framegraph/qframegraphnodecreatedchange.cpp
@@ -36,7 +36,9 @@
#include "qframegraphnodecreatedchange.h"
#include "qframegraphnodecreatedchange_p.h"
+
#include <Qt3DRender/qframegraphnode.h>
+#include <Qt3DRender/private/qframegraphnode_p.h>
QT_BEGIN_NAMESPACE
@@ -45,6 +47,7 @@ namespace Qt3DRender {
QFrameGraphNodeCreatedChangeBasePrivate::QFrameGraphNodeCreatedChangeBasePrivate(const QFrameGraphNode *node)
: Qt3DCore::QNodeCreatedChangeBasePrivate(node)
, m_parentFrameGraphNodeId(Qt3DCore::qIdForNode(node->parentFrameGraphNode()))
+ , m_childFrameGraphNodeIds(Qt3DCore::qIdsForNodes(QFrameGraphNodePrivate::get(node)->childFrameGraphNodes()))
{
}
diff --git a/src/render/framegraph/qframegraphnodecreatedchange_p.h b/src/render/framegraph/qframegraphnodecreatedchange_p.h
index 9aa396b8f..c0437afc5 100644
--- a/src/render/framegraph/qframegraphnodecreatedchange_p.h
+++ b/src/render/framegraph/qframegraphnodecreatedchange_p.h
@@ -49,6 +49,7 @@
//
#include <Qt3DCore/private/qnodecreatedchange_p.h>
+#include <Qt3DRender/qframegraphnodecreatedchange.h>
QT_BEGIN_NAMESPACE
@@ -62,6 +63,16 @@ public:
QFrameGraphNodeCreatedChangeBasePrivate(const QFrameGraphNode *node);
Qt3DCore::QNodeId m_parentFrameGraphNodeId;
+ Qt3DCore::QNodeIdVector m_childFrameGraphNodeIds;
+
+ static QFrameGraphNodeCreatedChangeBasePrivate *get(QFrameGraphNodeCreatedChangeBase *change)
+ {
+ return change->d_func();
+ }
+ static const QFrameGraphNodeCreatedChangeBasePrivate *get(const QFrameGraphNodeCreatedChangeBase *change)
+ {
+ return change->d_func();
+ }
};
} // Qt3DRender
diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp
index 09cb75e46..ccec826ff 100644
--- a/src/render/frontend/qrenderaspect.cpp
+++ b/src/render/frontend/qrenderaspect.cpp
@@ -481,7 +481,7 @@ QVector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time)
// which should likely be renamed to something more generic or we introduce
// another synchronizing job for skeleton loading
const QVector<Render::HSkeleton> skeletonsToLoad =
- manager->skeletonManager()->dirtySkeletons(Render::SkeletonManager::SkeletonDataDirty);
+ manager->skeletonManager()->takeDirtySkeletons(Render::SkeletonManager::SkeletonDataDirty);
for (const auto &skeletonHandle : skeletonsToLoad) {
auto loadSkeletonJob = Render::LoadSkeletonJobPtr::create(skeletonHandle);
loadSkeletonJob->setNodeManagers(manager);
diff --git a/src/render/io/qsceneloader.cpp b/src/render/io/qsceneloader.cpp
index 70af313a2..f039933b0 100644
--- a/src/render/io/qsceneloader.cpp
+++ b/src/render/io/qsceneloader.cpp
@@ -81,7 +81,7 @@ namespace Qt3DRender {
Qt3DRender::QSceneLoader internally relies on the use of plugins to support a
wide variety of 3D file formats. \l
- {http://www.assimp.org/main_features_formats.html}{Here} is a list of formats
+ {http://assimp.sourceforge.net/main_features_formats.html}{Here} is a list of formats
that are supported by Qt3D.
\note this component shouldn't be shared among several Qt3DCore::QEntity instances.
diff --git a/src/render/materialsystem/qgraphicsapifilter_p.h b/src/render/materialsystem/qgraphicsapifilter_p.h
index 5a7d874ed..f4581ac05 100644
--- a/src/render/materialsystem/qgraphicsapifilter_p.h
+++ b/src/render/materialsystem/qgraphicsapifilter_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
-struct Q_AUTOTEST_EXPORT GraphicsApiFilterData
+struct QT3DRENDERSHARED_PRIVATE_EXPORT GraphicsApiFilterData
{
GraphicsApiFilterData();
diff --git a/src/render/materialsystem/shaderbuilder_p.h b/src/render/materialsystem/shaderbuilder_p.h
index b76c8389f..e9378e3c5 100644
--- a/src/render/materialsystem/shaderbuilder_p.h
+++ b/src/render/materialsystem/shaderbuilder_p.h
@@ -61,7 +61,7 @@ namespace Qt3DRender {
namespace Render {
-class Q_AUTOTEST_EXPORT ShaderBuilder : public BackendNode
+class QT3DRENDERSHARED_PRIVATE_EXPORT ShaderBuilder : public BackendNode
{
public:
enum ShaderType {
diff --git a/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp
index 1e2035c01..59b5701f8 100644
--- a/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp
+++ b/src/render/renderers/opengl/graphicshelpers/graphicscontext.cpp
@@ -226,7 +226,7 @@ QOpenGLShaderProgram *GraphicsContext::createShaderProgram(Shader *shaderNode)
const auto shaderCode = shaderNode->shaderCode();
QString logs;
for (int i = QShaderProgram::Vertex; i <= QShaderProgram::Compute; ++i) {
- const QShaderProgram::ShaderType type = static_cast<const QShaderProgram::ShaderType>(i);
+ const QShaderProgram::ShaderType type = static_cast<QShaderProgram::ShaderType>(i);
if (!shaderCode.at(i).isEmpty()) {
// Note: logs only return the error but not all the shader code
// we could append it
diff --git a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
index 26ee94305..d9077976c 100644
--- a/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/render/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -76,6 +76,7 @@
#include <Qt3DRender/private/graphicshelperes2_p.h>
#include <Qt3DRender/private/graphicshelperes3_p.h>
+#include <private/qdebug_p.h>
#include <QSurface>
#include <QWindow>
#include <QOpenGLTexture>
@@ -707,8 +708,10 @@ QImage SubmissionContext::readFramebuffer(const QRect &rect)
break;
#endif
default:
- // unsupported format
- Q_UNREACHABLE();
+ auto warning = qWarning();
+ warning << "Unable to convert";
+ QtDebugUtils::formatQEnum(warning, m_renderTargetFormat);
+ warning << "render target texture format to QImage.";
return img;
}
diff --git a/src/render/renderers/opengl/renderer/renderer.cpp b/src/render/renderers/opengl/renderer/renderer.cpp
index 8039b6412..8b98c658c 100644
--- a/src/render/renderers/opengl/renderer/renderer.cpp
+++ b/src/render/renderers/opengl/renderer/renderer.cpp
@@ -244,11 +244,9 @@ Renderer::Renderer(QRenderAspect::RenderType type)
Renderer::~Renderer()
{
- // If using a threaded rendering approach, tell the thread to exit
- // and wait for it to be done
- m_running.fetchAndStoreOrdered(0);
+ Q_ASSERT(m_running.fetchAndStoreOrdered(0) == 0);
if (m_renderThread)
- m_renderThread->wait();
+ Q_ASSERT(m_renderThread->isFinished());
delete m_renderQueue;
delete m_defaultRenderStateSet;
diff --git a/src/render/renderers/opengl/textures/gltexture.cpp b/src/render/renderers/opengl/textures/gltexture.cpp
index e98f3965d..cb83e9c1e 100644
--- a/src/render/renderers/opengl/textures/gltexture.cpp
+++ b/src/render/renderers/opengl/textures/gltexture.cpp
@@ -40,6 +40,7 @@
#include <QtCore/qhash.h>
#include "gltexture_p.h"
+#include <private/qdebug_p.h>
#include <QDebug>
#include <QOpenGLFunctions>
#include <QOpenGLTexture>
@@ -383,7 +384,9 @@ QOpenGLTexture *GLTexture::buildGLTexture()
format = QAbstractTexture::DepthFormat;
break;
default:
- qWarning() << Q_FUNC_INFO << "could not find a matching OpenGL ES 2.0 unsized texture format";
+ auto warning = qWarning();
+ warning << "Could not find a matching OpenGL ES 2.0 texture format:";
+ QtDebugUtils::formatQEnum(warning, m_properties.format);
break;
}
}