summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp2
-rw-r--r--src/plugins/renderers/opengl/renderer/renderview.cpp4
-rw-r--r--src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h5
-rw-r--r--src/render/backend/managers_p.h2
-rw-r--r--src/render/framegraph/qrenderpassfilter.cpp9
-rw-r--r--src/render/framegraph/qtechniquefilter.cpp10
-rw-r--r--src/render/materialsystem/qeffect.cpp10
-rw-r--r--src/render/materialsystem/qmaterial.cpp10
-rw-r--r--src/render/materialsystem/qtechnique.cpp12
-rw-r--r--src/render/picking/objectpicker.cpp5
-rw-r--r--src/render/picking/qpicktriangleevent_p.h11
-rw-r--r--tests/auto/render/objectpicker/tst_objectpicker.cpp15
13 files changed, 72 insertions, 25 deletions
diff --git a/.qmake.conf b/.qmake.conf
index a17c06927..f690718eb 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -6,4 +6,4 @@ load(qt_build_config)
DEFINES += QT_NO_FOREACH
DEFINES += QT_NO_JAVA_STYLE_ITERATORS
-MODULE_VERSION = 5.15.3
+MODULE_VERSION = 5.15.5
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
index ab5948e49..ef32594e1 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -1598,7 +1598,7 @@ void SubmissionContext::blitFramebuffer(Qt3DCore::QNodeId inputRenderTargetId,
if (!outputBufferIsDefault) {
// Note that we use glDrawBuffers, not glDrawBuffer. The
// latter is not available with GLES.
- const int buf = glAttachmentPoint(outputAttachmentPoint);
+ const int buf = outputAttachmentPoint;
drawBuffers(1, &buf);
}
diff --git a/src/plugins/renderers/opengl/renderer/renderview.cpp b/src/plugins/renderers/opengl/renderer/renderview.cpp
index 8c2d5a39d..007fb07e0 100644
--- a/src/plugins/renderers/opengl/renderer/renderview.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderview.cpp
@@ -1080,6 +1080,7 @@ void RenderView::setShaderAndUniforms(RenderCommand *command,
command->m_parameterPack.reserve(shader->parameterPackSize());
}
+ const size_t previousUniformCount = command->m_parameterPack.uniforms().size();
if (shader->hasActiveVariables()) {
const QVector<int> &standardUniformNamesIds = shader->standardUniformNameIds();
@@ -1104,8 +1105,9 @@ void RenderView::setShaderAndUniforms(RenderCommand *command,
updateLightUniforms(command, entity);
}
+ const size_t actualUniformCount = command->m_parameterPack.uniforms().size();
// Prepare the ShaderParameterPack based on the active uniforms of the shader
- if (!updateUniformsOnly)
+ if (!updateUniformsOnly || previousUniformCount != actualUniformCount)
shader->prepareUniforms(command->m_parameterPack);
}
diff --git a/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h b/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h
index 5596c2937..841aae61a 100644
--- a/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h
+++ b/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h
@@ -105,6 +105,11 @@ struct PackUniformHash
values.reserve(count);
}
+ size_t size() const
+ {
+ return keys.size();
+ }
+
inline int indexForKey(int key) const
{
const auto b = keys.cbegin();
diff --git a/src/render/backend/managers_p.h b/src/render/backend/managers_p.h
index a3d42d24a..864c168be 100644
--- a/src/render/backend/managers_p.h
+++ b/src/render/backend/managers_p.h
@@ -200,7 +200,7 @@ public:
class Q_3DRENDERSHARED_PRIVATE_EXPORT ShaderManager : public Qt3DCore::QResourceManager<
Shader,
Qt3DCore::QNodeId,
- Qt3DCore::NonLockingPolicy>
+ Qt3DCore::ObjectLevelLockingPolicy>
{
public:
ShaderManager() {}
diff --git a/src/render/framegraph/qrenderpassfilter.cpp b/src/render/framegraph/qrenderpassfilter.cpp
index 34462ebdf..f7fafb7d1 100644
--- a/src/render/framegraph/qrenderpassfilter.cpp
+++ b/src/render/framegraph/qrenderpassfilter.cpp
@@ -63,8 +63,8 @@ namespace Qt3DRender {
whose Qt3DRender::QFilterKey objects match the keys in QRenderPassFilter are
selected for rendering. If no QRenderPassFilter is present, then all QRenderPass
objects are selected for rendering. The parameters in the list can be used
- to set values for shader parameters. The parameters in QRenderPassFilter are
- overridden by parameters in QTechniqueFilter, QTechnique and QRenderPass.
+ to set values for shader parameters. The parameters in QRenderPassFilter
+ override parameters in QTechniqueFilter, QMaterial, QEffect, QTechnique and QRenderPass.
*/
/*!
@@ -79,7 +79,10 @@ namespace Qt3DRender {
objects are selected for drawing. When RenderPassFilter is present in the FrameGraph,
only the RenderPass objects, whose FilterKey objects match the keys
in RenderPassFilter are selected for rendering. If no RenderPassFilter is present,
- then all RenderPass objects are selected for rendering.
+ then all RenderPass objects are selected for rendering. RenderPassFilter
+ specifies a list of Parameter objects. The parameters in the list can be used
+ to set values for shader parameters. The parameters in RenderPassFilter
+ override parameters in TechniqueFilter, Material, Effect, Technique and RenderPass.
*/
/*!
diff --git a/src/render/framegraph/qtechniquefilter.cpp b/src/render/framegraph/qtechniquefilter.cpp
index 5377e1297..2149d147e 100644
--- a/src/render/framegraph/qtechniquefilter.cpp
+++ b/src/render/framegraph/qtechniquefilter.cpp
@@ -65,8 +65,9 @@ QTechniqueFilterPrivate::QTechniqueFilterPrivate()
a list of Qt3DRender::QFilterKey objects and Qt3DRender::QParameter objects.
When QTechniqueFilter is present in the FrameGraph, only the techiques matching
the keys in the list are used for rendering. The parameters in the list can be used
- to set values for shader parameters. The parameters in QTechniqueFilter are
- overridden by parameters in QTechnique and QRenderPass.
+ to set values for shader parameters. The parameters in QTechniqueFilter
+ override parameters in QMaterial, QEffect, QTechnique and QRenderPass, but are overridden
+ by parameters in QRenderPassFilter.
*/
/*!
@@ -82,8 +83,9 @@ QTechniqueFilterPrivate::QTechniqueFilterPrivate()
a list of FilterKey objects and Parameter objects.
When TechniqueFilter is present in the FrameGraph, only the techiques matching
the keys in list are used for rendering. The parameters in the list can be used
- to set values for shader parameters. The parameters in TechniqueFilter are
- overridden by parameters in Technique and RenderPass.
+ to set values for shader parameters. The parameters in TechniqueFilter
+ override parameters in Material, Effect, Technique and RenderPass, but are overridden
+ by parameters in RenderPassFilter.
*/
/*!
diff --git a/src/render/materialsystem/qeffect.cpp b/src/render/materialsystem/qeffect.cpp
index 9f4b3db94..01d887792 100644
--- a/src/render/materialsystem/qeffect.cpp
+++ b/src/render/materialsystem/qeffect.cpp
@@ -91,8 +91,9 @@ QEffectPrivate::QEffectPrivate()
effect->addTechnique(gl3Technique);
\endcode
- A QParameter defined on an Effect is overridden by a QParameter (of the same
- name) defined in a QMaterial, QTechniqueFilter, QRenderPassFilter.
+ A QParameter defined on a QEffect overrides parameter (of the same
+ name) defined in QTechnique and QRenderPass, but are overridden by parameter in
+ QRenderPassFilter, QTechniqueFilter and QMaterial.
\sa QMaterial, QTechnique, QParameter
*/
@@ -110,8 +111,9 @@ QEffectPrivate::QEffectPrivate()
An Effect instance should be shared among several Material instances when possible.
- A Parameter defined on an Effect is overridden by a QParameter (of the same
- name) defined in a Material, TechniqueFilter, RenderPassFilter.
+ A Parameter defined on a Effect overrides parameter (of the same
+ name) defined in Technique and RenderPass, but are overridden by parameter in
+ RenderPassFilter, TechniqueFilter and Material.
\note Effect node can not be disabled.
diff --git a/src/render/materialsystem/qmaterial.cpp b/src/render/materialsystem/qmaterial.cpp
index a1bec183b..f41dcacde 100644
--- a/src/render/materialsystem/qmaterial.cpp
+++ b/src/render/materialsystem/qmaterial.cpp
@@ -65,8 +65,9 @@
techniques, passes and shaders once while allowing to specify the material
by adding Parameter instances.
- A Parameter defined on a Material is overridden by a Parameter (of the same
- name) defined in a TechniqueFilter or a RenderPassFilter.
+ A Parameter defined on a Material overrides parameter (of the same
+ name) defined in a Effect, Technique and RenderPass, but are overridden by parameters in
+ RenderPassFilter and TechniqueFilter.
\code
Effect {
@@ -133,8 +134,9 @@
techniques, passes and shaders once while allowing to specify the material
by adding QParameter instances.
- A QParameter defined on a QMaterial is overridden by a QParameter (of the same
- name) defined in a QTechniqueFilter or a QRenderPassFilter.
+ A QParameter defined on a QMaterial overrides parameter (of the same
+ name) defined in a QEffect, QTechnique and QRenderPass, but are overridden by parameter in
+ QRenderPassFilter and QTechniqueFilter.
\code
QMaterial *material1 = new QMaterial();
diff --git a/src/render/materialsystem/qtechnique.cpp b/src/render/materialsystem/qtechnique.cpp
index 0e1787938..caa8b0fb7 100644
--- a/src/render/materialsystem/qtechnique.cpp
+++ b/src/render/materialsystem/qtechnique.cpp
@@ -69,9 +69,9 @@ QTechniquePrivate::~QTechniquePrivate()
Parameter objects and a GraphicsApiFilter, which together define a
rendering technique the given graphics API can render. The filter keys are
used by TechniqueFilter to select specific techniques at specific parts of
- the FrameGraph. If two Parameter instances with the same name are specified
- in a Technique and a RenderPass, the one in Technique overrides the one
- used in the RenderPass.
+ the FrameGraph. A Parameter defined on a Technique overrides parameter
+ (of the same name) defined in RenderPass, but are overridden by
+ parameter in RenderPassFilter, TechniqueFilter, Material and Effect.
When creating an Effect that targets several versions of a graphics API, it
is useful to create several Technique nodes each with a graphicsApiFilter
@@ -136,9 +136,9 @@ QTechniquePrivate::~QTechniquePrivate()
a Qt3DRender::QGraphicsApiFilter, which together define a rendering
technique the given graphics API can render. The filter keys are used by
Qt3DRender::QTechniqueFilter to select specific techniques at specific
- parts of the FrameGraph. If two QParameter instances with the same name are
- specified in a QTechnique and a QRenderPass, the one in Technique overrides
- the one used in the QRenderPass.
+ parts of the FrameGraph. A QParameter defined on a QTechnique overrides parameter
+ (of the same name) defined in QRenderPass, but are overridden by
+ parameter in QRenderPassFilter, QTechniqueFilter, QMaterial and QEffect.
When creating an QEffect that targets several versions of a graphics API,
it is useful to create several QTechnique nodes each with a
diff --git a/src/render/picking/objectpicker.cpp b/src/render/picking/objectpicker.cpp
index 2835d1b0e..182e1af55 100644
--- a/src/render/picking/objectpicker.cpp
+++ b/src/render/picking/objectpicker.cpp
@@ -83,6 +83,11 @@ void ObjectPicker::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstT
BackendNode::syncFromFrontEnd(frontEnd, firstTime);
+ if (firstTime) {
+ markDirty(AbstractRenderer::AllDirty);
+ notifyJob();
+ }
+
if (node->isHoverEnabled() != m_hoverEnabled) {
m_hoverEnabled = node->isHoverEnabled();
markDirty(AbstractRenderer::AllDirty);
diff --git a/src/render/picking/qpicktriangleevent_p.h b/src/render/picking/qpicktriangleevent_p.h
index d646ac2bb..8ed4f26f5 100644
--- a/src/render/picking/qpicktriangleevent_p.h
+++ b/src/render/picking/qpicktriangleevent_p.h
@@ -40,6 +40,17 @@
#ifndef QT3DRENDER_QPICKTRIANGLEEVENT_P_H
#define QT3DRENDER_QPICKTRIANGLEEVENT_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists for the convenience
+// of other Qt classes. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <Qt3DRender/private/qpickevent_p.h>
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/render/objectpicker/tst_objectpicker.cpp b/tests/auto/render/objectpicker/tst_objectpicker.cpp
index 24fa2159d..b1898e040 100644
--- a/tests/auto/render/objectpicker/tst_objectpicker.cpp
+++ b/tests/auto/render/objectpicker/tst_objectpicker.cpp
@@ -40,6 +40,21 @@ class tst_ObjectPicker : public Qt3DCore::QBackendNodeTester
Q_OBJECT
private Q_SLOTS:
+ void checkInitialSync()
+ {
+ // GIVEN
+ TestRenderer renderer;
+ Qt3DRender::Render::ObjectPicker objectPicker;
+ Qt3DRender::QObjectPicker picker;
+
+ // WHEN
+ objectPicker.setRenderer(&renderer);
+ simulateInitializationSync(&picker, &objectPicker);
+
+ // THEN
+ QVERIFY(renderer.dirtyBits() != 0);
+ }
+
void checkPeerPropertyMirroring()
{
// GIVEN