summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-10 21:34:10 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-10 21:34:10 +0100
commitb0e11393968ceaad8c35e7df528c73a5e6111f32 (patch)
tree38ba2cd55e2c605225d583225814ada8b995d743 /src/render
parent55b52c47030c759f8b38013eb873c0b161d0e426 (diff)
parent82eb8b44e0a3d1dc586acc52132be2b05102900c (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf Change-Id: Ie8a4bf768bffba61dca9e315151c035be7b48723
Diffstat (limited to 'src/render')
-rw-r--r--src/render/framegraph/qrendercapture.cpp3
-rw-r--r--src/render/jobs/abstractpickingjob.cpp11
-rw-r--r--src/render/renderers/opengl/renderer/renderer.cpp3
-rw-r--r--src/render/renderers/opengl/renderer/renderview.cpp7
4 files changed, 17 insertions, 7 deletions
diff --git a/src/render/framegraph/qrendercapture.cpp b/src/render/framegraph/qrendercapture.cpp
index d5b6d63ae..5bda569f9 100644
--- a/src/render/framegraph/qrendercapture.cpp
+++ b/src/render/framegraph/qrendercapture.cpp
@@ -252,9 +252,6 @@ QRenderCapturePrivate::QRenderCapturePrivate()
*/
QRenderCapturePrivate::~QRenderCapturePrivate()
{
- Q_Q(QRenderCapture);
- for (QRenderCaptureReply *reply : qAsConst(m_waitingReplies))
- reply->disconnect(q);
}
/*!
diff --git a/src/render/jobs/abstractpickingjob.cpp b/src/render/jobs/abstractpickingjob.cpp
index ccb190cff..74e6a7f80 100644
--- a/src/render/jobs/abstractpickingjob.cpp
+++ b/src/render/jobs/abstractpickingjob.cpp
@@ -122,15 +122,22 @@ RayCasting::QRay3D AbstractPickingJob::rayForViewportAndCamera(const PickingUtil
const QPoint &pos) const
{
static RayCasting::QRay3D invalidRay({}, {}, 0.f);
+
+ if (!vca.area.isValid())
+ return invalidRay;
+
Matrix4x4 viewMatrix;
Matrix4x4 projectionMatrix;
Render::CameraLens::viewMatrixForCamera(m_manager->renderNodesManager(),
vca.cameraId,
viewMatrix,
projectionMatrix);
+ // Returns viewport rect in GL coordinates (y inverted)
const QRect viewport = windowViewport(vca.area, vca.viewport);
+ // In GL the y is inverted compared to Qt
+ const QPoint glCorrectPos = QPoint(pos.x(), vca.area.height() - pos.y());
- if (vca.area.isValid() && !viewport.contains(pos))
+ if (!viewport.contains(glCorrectPos))
return invalidRay;
if (vca.surface) {
QSurface *surface = nullptr;
@@ -148,8 +155,6 @@ RayCasting::QRay3D AbstractPickingJob::rayForViewportAndCamera(const PickingUtil
return invalidRay;
}
- // In GL the y is inverted compared to Qt
- const QPoint glCorrectPos = QPoint(pos.x(), vca.area.isValid() ? vca.area.height() - pos.y() : pos.y());
const auto ray = intersectionRay(glCorrectPos, viewMatrix, projectionMatrix, viewport);
return ray;
}
diff --git a/src/render/renderers/opengl/renderer/renderer.cpp b/src/render/renderers/opengl/renderer/renderer.cpp
index 9aed183b0..4abe62bab 100644
--- a/src/render/renderers/opengl/renderer/renderer.cpp
+++ b/src/render/renderers/opengl/renderer/renderer.cpp
@@ -1797,7 +1797,8 @@ QVector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs()
renderBinJobs.push_back(m_updateShaderDataTransformJob);
}
- if (dirtyBitsForFrame & AbstractRenderer::GeometryDirty) {
+ if (dirtyBitsForFrame & AbstractRenderer::GeometryDirty ||
+ dirtyBitsForFrame & AbstractRenderer::BuffersDirty) {
renderBinJobs.push_back(m_calculateBoundingVolumeJob);
renderBinJobs.push_back(m_updateMeshTriangleListJob);
}
diff --git a/src/render/renderers/opengl/renderer/renderview.cpp b/src/render/renderers/opengl/renderer/renderview.cpp
index 39fed2294..3aa45c836 100644
--- a/src/render/renderers/opengl/renderer/renderview.cpp
+++ b/src/render/renderers/opengl/renderer/renderview.cpp
@@ -1065,6 +1065,13 @@ void RenderView::setShaderAndUniforms(RenderCommand *command,
setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader, shaderData, QStringLiteral("envLight"));
envLightCount = 1;
}
+ } else {
+ // with some drivers, samplers (like the envbox sampler) need to be bound even though
+ // they may not be actually used, otherwise draw calls can fail
+ static const int irradianceId = StringToInt::lookupId(QLatin1String("envLight.irradiance"));
+ static const int specularId = StringToInt::lookupId(QLatin1String("envLight.specular"));
+ setUniformValue(command->m_parameterPack, irradianceId, m_renderer->submissionContext()->maxTextureUnitsCount());
+ setUniformValue(command->m_parameterPack, specularId, m_renderer->submissionContext()->maxTextureUnitsCount());
}
setUniformValue(command->m_parameterPack, StringToInt::lookupId(QStringLiteral("envLightCount")), envLightCount);
}