summaryrefslogtreecommitdiffstats
path: root/src/plugins/renderers/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/renderers/opengl')
-rw-r--r--src/plugins/renderers/opengl/CMakeLists.txt6
-rw-r--r--src/plugins/renderers/opengl/debug/debug.pri9
-rw-r--r--src/plugins/renderers/opengl/debug/imguirenderer.cpp161
-rw-r--r--src/plugins/renderers/opengl/debug/imguirenderer_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp66
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h42
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp43
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp53
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1.cpp44
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp42
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h43
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp43
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp45
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp45
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp56
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/graphicshelpers.pri33
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext.cpp43
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext_p.h40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h51
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp90
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h42
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext.cpp40
-rw-r--r--src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext_p.h40
-rw-r--r--src/plugins/renderers/opengl/io/glbuffer.cpp40
-rw-r--r--src/plugins/renderers/opengl/io/glbuffer_p.h40
-rw-r--r--src/plugins/renderers/opengl/io/io.pri8
-rw-r--r--src/plugins/renderers/opengl/main.cpp40
-rw-r--r--src/plugins/renderers/opengl/managers/gl_handle_types_p.h40
-rw-r--r--src/plugins/renderers/opengl/managers/glresourcemanagers.cpp40
-rw-r--r--src/plugins/renderers/opengl/managers/glresourcemanagers_p.h40
-rw-r--r--src/plugins/renderers/opengl/managers/managers.pri8
-rw-r--r--src/plugins/renderers/opengl/opengl.cmake3
-rw-r--r--src/plugins/renderers/opengl/opengl.pri41
-rw-r--r--src/plugins/renderers/opengl/opengl.pro13
-rw-r--r--src/plugins/renderers/opengl/renderer/commandexecuter.cpp42
-rw-r--r--src/plugins/renderers/opengl/renderer/commandexecuter_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/frameprofiler_p.h44
-rw-r--r--src/plugins/renderers/opengl/renderer/glfence_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/gllights.cpp40
-rw-r--r--src/plugins/renderers/opengl/renderer/gllights_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/glshader.cpp55
-rw-r--r--src/plugins/renderers/opengl/renderer/glshader_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/logging.cpp40
-rw-r--r--src/plugins/renderers/opengl/renderer/logging_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp47
-rw-r--r--src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/rendercommand.cpp40
-rw-r--r--src/plugins/renderers/opengl/renderer/rendercommand_p.h42
-rw-r--r--src/plugins/renderers/opengl/renderer/renderer.cpp118
-rw-r--r--src/plugins/renderers/opengl/renderer/renderer.pri29
-rw-r--r--src/plugins/renderers/opengl/renderer/renderer_p.h43
-rw-r--r--src/plugins/renderers/opengl/renderer/renderview.cpp82
-rw-r--r--src/plugins/renderers/opengl/renderer/renderview_p.h44
-rw-r--r--src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp45
-rw-r--r--src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp60
-rw-r--r--src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h40
-rw-r--r--src/plugins/renderers/opengl/renderer/shadervariables_p.h40
-rw-r--r--src/plugins/renderers/opengl/textures/gltexture.cpp54
-rw-r--r--src/plugins/renderers/opengl/textures/gltexture_p.h40
-rw-r--r--src/plugins/renderers/opengl/textures/renderbuffer.cpp40
-rw-r--r--src/plugins/renderers/opengl/textures/renderbuffer_p.h40
-rw-r--r--src/plugins/renderers/opengl/textures/textures.pri9
71 files changed, 380 insertions, 2684 deletions
diff --git a/src/plugins/renderers/opengl/CMakeLists.txt b/src/plugins/renderers/opengl/CMakeLists.txt
index de485138a..82328d1f9 100644
--- a/src/plugins/renderers/opengl/CMakeLists.txt
+++ b/src/plugins/renderers/opengl/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
# Generated from opengl.pro.
set(openGLRendererSources graphicshelpers/graphicscontext.cpp graphicshelpers/graphicscontext_p.h
@@ -118,6 +121,9 @@ qt_internal_add_plugin(OpenGLRendererPlugin
Qt::OpenGLPrivate
)
+# QTransform conflicts
+set_target_properties(OpenGLRendererPlugin PROPERTIES UNITY_BUILD OFF)
+
qt_internal_extend_target(OpenGLRendererPlugin CONDITION NOT INTEGRITY
SOURCES
debug/imguirenderer.cpp debug/imguirenderer_p.h
diff --git a/src/plugins/renderers/opengl/debug/debug.pri b/src/plugins/renderers/opengl/debug/debug.pri
deleted file mode 100644
index 38a056f6b..000000000
--- a/src/plugins/renderers/opengl/debug/debug.pri
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDEPATH += $$PWD
-
-include($$QT3D_ROOT/src/3rdparty/imgui/imgui.pri)
-
-HEADERS += \
- $$PWD/imguirenderer_p.h
-
-SOURCES += \
- $$PWD/imguirenderer.cpp
diff --git a/src/plugins/renderers/opengl/debug/imguirenderer.cpp b/src/plugins/renderers/opengl/debug/imguirenderer.cpp
index 744060fcf..e2ea3d203 100644
--- a/src/plugins/renderers/opengl/debug/imguirenderer.cpp
+++ b/src/plugins/renderers/opengl/debug/imguirenderer.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
/*
* Based on https://github.com/seanchas116/qtimgui/
@@ -67,10 +31,8 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DRender;
-using namespace Render;
-using namespace Render::Debug;
-using namespace Render::OpenGL;
+namespace Qt3DRR = Qt3DRender::Render;
+namespace Qt3DRRD = Qt3DRR::Debug;
namespace {
@@ -102,42 +64,69 @@ namespace {
int vertexToPrimitiveCount(Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType, int numVertices) {
int nPrimitives = 0;
switch (primitiveType) {
- case QGeometryRenderer::Points:
- case QGeometryRenderer::LineLoop: nPrimitives += numVertices; break;
- case QGeometryRenderer::Triangles: nPrimitives += numVertices / 3; break;
- case QGeometryRenderer::Lines: nPrimitives += numVertices / 2; break;
- case QGeometryRenderer::TriangleFan:
- case QGeometryRenderer::TriangleStrip:
- case QGeometryRenderer::LineStrip: nPrimitives += numVertices - 1; break;
- case QGeometryRenderer::TrianglesAdjacency: nPrimitives += numVertices / 6; break;
- case QGeometryRenderer::TriangleStripAdjacency:
- case QGeometryRenderer::LineStripAdjacency: nPrimitives += numVertices / 2 - 1; break;
- case QGeometryRenderer::LinesAdjacency: nPrimitives += numVertices / 4; break;
- case QGeometryRenderer::Patches: nPrimitives += 1;
+ case Qt3DRender::QGeometryRenderer::Points:
+ case Qt3DRender::QGeometryRenderer::LineLoop:
+ nPrimitives += numVertices;
+ break;
+ case Qt3DRender::QGeometryRenderer::Triangles:
+ nPrimitives += numVertices / 3;
+ break;
+ case Qt3DRender::QGeometryRenderer::Lines:
+ nPrimitives += numVertices / 2;
+ break;
+ case Qt3DRender::QGeometryRenderer::TriangleFan:
+ case Qt3DRender::QGeometryRenderer::TriangleStrip:
+ case Qt3DRender::QGeometryRenderer::LineStrip:
+ nPrimitives += numVertices - 1;
+ break;
+ case Qt3DRender::QGeometryRenderer::TrianglesAdjacency:
+ nPrimitives += numVertices / 6;
+ break;
+ case Qt3DRender::QGeometryRenderer::TriangleStripAdjacency:
+ case Qt3DRender::QGeometryRenderer::LineStripAdjacency:
+ nPrimitives += numVertices / 2 - 1;
+ break;
+ case Qt3DRender::QGeometryRenderer::LinesAdjacency:
+ nPrimitives += numVertices / 4;
+ break;
+ case Qt3DRender::QGeometryRenderer::Patches:
+ nPrimitives += 1;
}
return nPrimitives;
}
const char *primitiveTypeName(Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType) {
switch (primitiveType) {
- case QGeometryRenderer::Points: return "Points";
- case QGeometryRenderer::LineLoop: return "LineLoop";
- case QGeometryRenderer::Triangles: return "Triangles";
- case QGeometryRenderer::TrianglesAdjacency: return "TriangleAdjacency";
- case QGeometryRenderer::TriangleFan: return "TriangleFan";
- case QGeometryRenderer::TriangleStrip: return "TriangleStrip";
- case QGeometryRenderer::TriangleStripAdjacency: return "TriangleStringAdjacency";
- case QGeometryRenderer::LineStrip: return "LineStrip";
- case QGeometryRenderer::LineStripAdjacency: return "LineStripAdjacency";
- case QGeometryRenderer::Lines: return "Lines";
- case QGeometryRenderer::LinesAdjacency: return "LinesAdjacency";
- case QGeometryRenderer::Patches: return "Patches";
+ case Qt3DRender::QGeometryRenderer::Points:
+ return "Points";
+ case Qt3DRender::QGeometryRenderer::LineLoop:
+ return "LineLoop";
+ case Qt3DRender::QGeometryRenderer::Triangles:
+ return "Triangles";
+ case Qt3DRender::QGeometryRenderer::TrianglesAdjacency:
+ return "TriangleAdjacency";
+ case Qt3DRender::QGeometryRenderer::TriangleFan:
+ return "TriangleFan";
+ case Qt3DRender::QGeometryRenderer::TriangleStrip:
+ return "TriangleStrip";
+ case Qt3DRender::QGeometryRenderer::TriangleStripAdjacency:
+ return "TriangleStringAdjacency";
+ case Qt3DRender::QGeometryRenderer::LineStrip:
+ return "LineStrip";
+ case Qt3DRender::QGeometryRenderer::LineStripAdjacency:
+ return "LineStripAdjacency";
+ case Qt3DRender::QGeometryRenderer::Lines:
+ return "Lines";
+ case Qt3DRender::QGeometryRenderer::LinesAdjacency:
+ return "LinesAdjacency";
+ case Qt3DRender::QGeometryRenderer::Patches:
+ return "Patches";
}
return "";
}
}
-ImGuiRenderer::ImGuiRenderer(Qt3DRender::Render::OpenGL::Renderer *renderer)
+Qt3DRRD::ImGuiRenderer::ImGuiRenderer(Qt3DRR::OpenGL::Renderer *renderer)
: m_renderer(renderer)
{
ImGui::CreateContext();
@@ -164,9 +153,9 @@ ImGuiRenderer::ImGuiRenderer(Qt3DRender::Render::OpenGL::Renderer *renderer)
m_jobsRange.first = m_jobsRange.second = 0.f;
}
-ImGuiRenderer::~ImGuiRenderer() = default;
+Qt3DRRD::ImGuiRenderer::~ImGuiRenderer() = default;
-void ImGuiRenderer::renderDebugOverlay(const std::vector<RenderView *> &renderViews, const RenderView *renderView, int jobsInLastFrame)
+void Qt3DRRD::ImGuiRenderer::renderDebugOverlay(const std::vector<Qt3DRR::OpenGL::RenderView *> &renderViews, const Qt3DRR::OpenGL::RenderView *renderView, int jobsInLastFrame)
{
if (!newFrame(renderView))
return;
@@ -194,7 +183,7 @@ void ImGuiRenderer::renderDebugOverlay(const std::vector<RenderView *> &renderVi
{
ImGui::Begin("Qt3D Profiling");
char caption[50];
- sprintf(caption, "Avg %.3f ms/frame (%.1f FPS)", static_cast<double>(1000.0f / ImGui::GetIO().Framerate), static_cast<double>(ImGui::GetIO().Framerate));
+ snprintf(caption, sizeof(caption), "Avg %.3f ms/frame (%.1f FPS)", static_cast<double>(1000.0f / ImGui::GetIO().Framerate), static_cast<double>(ImGui::GetIO().Framerate));
ImGui::PlotLines("FPS", m_fpsLog, logIndex + 1, 0, caption, m_fpsRange.first, m_fpsRange.second, ImVec2(0, 80));
ImGui::PlotHistogram("Jobs", m_jobsLog, logIndex + 1, 0, nullptr, m_jobsRange.first, m_jobsRange.second, ImVec2(0, 80));
@@ -204,10 +193,10 @@ void ImGuiRenderer::renderDebugOverlay(const std::vector<RenderView *> &renderVi
QSet<HGeometryRenderer> inUseGeometries;
QSet<Qt3DCore::QNodeId> inUseTextures;
for (int j=0; j<renderViewsCount; j++) {
- RenderView *rv = renderViews.at(j);
+ Qt3DRR::OpenGL::RenderView *rv = renderViews.at(j);
nCommands += rv->commandCount();
- rv->forEachCommand([&] (const RenderCommand &command) {
- if (command.m_type != RenderCommand::Draw)
+ rv->forEachCommand([&](const Qt3DRR::OpenGL::RenderCommand &command) {
+ if (command.m_type != Qt3DRR::OpenGL::RenderCommand::Draw)
return;
nVertices += command.m_primitiveCount;
nPrimitives += vertexToPrimitiveCount(command.m_primitiveType, command.m_primitiveCount);
@@ -312,24 +301,24 @@ void ImGuiRenderer::renderDebugOverlay(const std::vector<RenderView *> &renderVi
renderDrawList(ImGui::GetDrawData());
}
-void ImGuiRenderer::setCapabilities(const QString &capabilities)
+void Qt3DRRD::ImGuiRenderer::setCapabilities(const QString &capabilities)
{
m_capabilities = capabilities.toLatin1();
}
-void ImGuiRenderer::showGLInfo()
+void Qt3DRRD::ImGuiRenderer::showGLInfo()
{
ImGui::Begin("Open GL Details", &m_showGLInfoWindow);
ImGui::Text("%s", m_capabilities.data());
ImGui::End();
}
-void ImGuiRenderer::showRenderDetails(const std::vector<RenderView *> &renderViews)
+void Qt3DRRD::ImGuiRenderer::showRenderDetails(const std::vector<Qt3DRR::OpenGL::RenderView *> &renderViews)
{
ImGui::Begin("Render Views", &m_showRenderDetailsWindow);
int i = 1;
- for (const RenderView *view: renderViews) {
+ for (const Qt3DRR::OpenGL::RenderView *view : renderViews) {
QString label(QLatin1String("View ") + QString::number(i++));
if (ImGui::TreeNode(label.toLatin1().data())) {
ImGui::Text("Viewport: (%.1f, %.1f, %.1f, %.1f)", view->viewport().x(), view->viewport().y(),
@@ -343,7 +332,7 @@ void ImGuiRenderer::showRenderDetails(const std::vector<RenderView *> &renderVie
ImGui::Text("Clear Stencil Value: %d", view->clearStencilValue());
int j = 1;
- view->forEachCommand([&] (const RenderCommand &command) {
+ view->forEachCommand([&](const Qt3DRR::OpenGL::RenderCommand &command) {
GeometryRenderer *rGeometryRenderer = m_renderer->nodeManagers()->data<GeometryRenderer, GeometryRendererManager>(command.m_geometryRenderer);
QString label = QString(QLatin1String("Command %1 {%2}")).arg(QString::number(j++), QString::number(rGeometryRenderer->peerId().id()));
if (ImGui::TreeNode(label.toLatin1().data())) {
@@ -366,7 +355,7 @@ void ImGuiRenderer::showRenderDetails(const std::vector<RenderView *> &renderVie
ImGui::End();
}
-void ImGuiRenderer::renderDrawList(ImDrawData *draw_data)
+void Qt3DRRD::ImGuiRenderer::renderDrawList(ImDrawData *draw_data)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
ImGuiIO& io = ImGui::GetIO();
@@ -463,7 +452,7 @@ void ImGuiRenderer::renderDrawList(ImDrawData *draw_data)
m_funcs->glScissor(last_scissor_box[0], last_scissor_box[1], static_cast<GLsizei>(last_scissor_box[2]), static_cast<GLsizei>(last_scissor_box[3]));
}
-bool ImGuiRenderer::createFontsTexture()
+bool Qt3DRRD::ImGuiRenderer::createFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
@@ -489,7 +478,7 @@ bool ImGuiRenderer::createFontsTexture()
return true;
}
-bool ImGuiRenderer::createDeviceObjects()
+bool Qt3DRRD::ImGuiRenderer::createDeviceObjects()
{
auto *glContext = m_renderer->submissionContext()->openGLContext();
if (glContext->format().majorVersion() < 3) {
@@ -607,7 +596,7 @@ bool ImGuiRenderer::createDeviceObjects()
return true;
}
-bool ImGuiRenderer::newFrame(const RenderView *renderView)
+bool Qt3DRRD::ImGuiRenderer::newFrame(const Qt3DRR::OpenGL::RenderView *renderView)
{
if (!m_funcs)
m_funcs = m_renderer->submissionContext()->openGLContext()->extraFunctions();
@@ -643,7 +632,7 @@ bool ImGuiRenderer::newFrame(const RenderView *renderView)
return true;
}
-void ImGuiRenderer::onMouseChange(QMouseEvent *event)
+void Qt3DRRD::ImGuiRenderer::onMouseChange(QMouseEvent *event)
{
ImGuiIO& io = ImGui::GetIO();
io.MousePos = ImVec2(event->pos().x(), event->pos().y());
@@ -652,14 +641,14 @@ void ImGuiRenderer::onMouseChange(QMouseEvent *event)
m_mousePressed[2] = event->buttons() & Qt::MiddleButton;
}
-void ImGuiRenderer::onWheel(QWheelEvent *event)
+void Qt3DRRD::ImGuiRenderer::onWheel(QWheelEvent *event)
{
// 5 lines per unit
m_mouseWheelH += event->pixelDelta().x() / (ImGui::GetTextLineHeight());
m_mouseWheel += event->pixelDelta().y() / (5.f * ImGui::GetTextLineHeight());
}
-void ImGuiRenderer::onKeyPressRelease(QKeyEvent *event)
+void Qt3DRRD::ImGuiRenderer::onKeyPressRelease(QKeyEvent *event)
{
ImGuiIO& io = ImGui::GetIO();
if (keyMap.contains(event->key()))
@@ -684,7 +673,7 @@ void ImGuiRenderer::onKeyPressRelease(QKeyEvent *event)
#endif
}
-void ImGuiRenderer::processEvent(QEvent *event)
+void Qt3DRRD::ImGuiRenderer::processEvent(QEvent *event)
{
switch (event->type()) {
case QEvent::MouseMove:
diff --git a/src/plugins/renderers/opengl/debug/imguirenderer_p.h b/src/plugins/renderers/opengl/debug/imguirenderer_p.h
index d70bd3259..50d063189 100644
--- a/src/plugins/renderers/opengl/debug/imguirenderer_p.h
+++ b/src/plugins/renderers/opengl/debug/imguirenderer_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3D_RENDER_GL_IMGUIRENDER_H_
#define QT3D_RENDER_GL_IMGUIRENDER_H_
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
index 287dfffe5..b62cad811 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicscontext_p.h"
@@ -64,9 +28,7 @@
#include <glshader_p.h>
#if !QT_CONFIG(opengles2)
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtOpenGL/QOpenGLVersionFunctionsFactory>
-#endif
#include <QOpenGLFunctions_2_0>
#include <QOpenGLFunctions_3_2_Core>
#include <QOpenGLFunctions_3_3_Core>
@@ -84,13 +46,9 @@
#include <QSurface>
#include <QWindow>
#include <QOpenGLTexture>
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#ifdef QT_OPENGL_LIB
#include <QtOpenGL/QOpenGLDebugLogger>
#endif
-#else
-#include <QOpenGLDebugLogger>
-#endif
QT_BEGIN_NAMESPACE
@@ -394,32 +352,16 @@ GraphicsHelperInterface *GraphicsContext::resolveHighestOpenGLFunctions()
#if !QT_CONFIG(opengles2)
else {
QAbstractOpenGLFunctions *glFunctions = nullptr;
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_3_Core>()) != nullptr) {
-#else
- if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_4_3_Core>()) != nullptr) {
-#endif
qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 4.3";
glHelper = new GraphicsHelperGL4();
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
} else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_3_Core>()) != nullptr) {
-#else
- } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_3_3_Core>()) != nullptr) {
-#endif
qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 3.3";
glHelper = new GraphicsHelperGL3_3();
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
} else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_2_Core>()) != nullptr) {
-#else
- } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_3_2_Core>()) != nullptr) {
-#endif
qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 3.2";
glHelper = new GraphicsHelperGL3_2();
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
} else if ((glFunctions = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_2_0>()) != nullptr) {
-#else
- } else if ((glFunctions = m_gl->versionFunctions<QOpenGLFunctions_2_0>()) != nullptr) {
-#endif
qCDebug(Backend) << Q_FUNC_INFO << " Building OpenGL 2 Helper";
glHelper = new GraphicsHelperGL2();
}
@@ -438,7 +380,7 @@ GraphicsHelperInterface *GraphicsContext::resolveHighestOpenGLFunctions()
qCDebug(Backend) << "Qt3D: Enabling OpenGL debug logging";
m_debugLogger.reset(new QOpenGLDebugLogger);
if (m_debugLogger->initialize()) {
- QObject::connect(m_debugLogger.data(), &QOpenGLDebugLogger::messageLogged, &logOpenGLDebugMessage);
+ QObject::connect(m_debugLogger.data(), &QOpenGLDebugLogger::messageLogged, m_debugLogger.data(), &logOpenGLDebugMessage);
const QString mode = QString::fromLocal8Bit(debugLoggingMode);
m_debugLogger->startLogging(mode.startsWith(QLatin1String("sync"), Qt::CaseInsensitive)
? QOpenGLDebugLogger::SynchronousLogging
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h
index ba474a89b..cdff6fa48 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicscontext_p.h
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSCONTEXT_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSCONTEXT_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp
index 9853b2b96..accc1e757 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelperes2_p.h"
#include <private/attachmentpack_p.h>
@@ -1018,8 +982,7 @@ UniformType GraphicsHelperES2::uniformTypeFromGLType(GLenum type)
case GL_SAMPLER_CUBE:
return UniformType::Sampler;
default:
- Q_UNREACHABLE();
- return UniformType::Float;
+ Q_UNREACHABLE_RETURN(UniformType::Float);
}
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2_p.h
index dd38b8c3a..5c51cb013 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes2_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES2_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES2_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp
index 8a516c110..75876686c 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 Svenn-Arne Dragly.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 Svenn-Arne Dragly.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelperes3_p.h"
#include <private/attachmentpack_p.h>
@@ -263,6 +227,17 @@ void GraphicsHelperES3::drawArraysInstanced(GLenum primitiveType, GLint first, G
instances);
}
+void GraphicsHelperES3::drawArraysInstancedBaseInstance(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances, GLsizei baseInstance)
+{
+ if (baseInstance != 0)
+ qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 3";
+
+ m_extraFuncs->glDrawArraysInstanced(primitiveType,
+ first,
+ count,
+ instances);
+}
+
void GraphicsHelperES3::readBuffer(GLenum mode)
{
m_extraFuncs->glReadBuffer(mode);
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1.cpp
index 965e7cab1..d82403d7b 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelperes3_1_p.h"
#include <qgraphicsutils_p.h>
@@ -154,7 +118,7 @@ namespace OpenGL {
namespace {
-GLbitfield memoryBarrierGLBitfield(QMemoryBarrier::Operations barriers)
+GLbitfield memoryBarrierGL3Bitfield(QMemoryBarrier::Operations barriers)
{
GLbitfield bits = 0;
@@ -240,7 +204,7 @@ void GraphicsHelperES3_1::dispatchCompute(GLuint wx, GLuint wy, GLuint wz)
void GraphicsHelperES3_1::memoryBarrier(QMemoryBarrier::Operations barriers)
{
- m_extraFuncs->glMemoryBarrier(memoryBarrierGLBitfield(barriers));
+ m_extraFuncs->glMemoryBarrier(memoryBarrierGL3Bitfield(barriers));
}
void GraphicsHelperES3_1::drawArraysIndirect(GLenum mode, void *indirect)
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1_p.h
index 126be1a3b..fe6d742e1 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_1_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_GRAPHICSHELPERES3_1_H
#define QT3DRENDER_RENDER_GRAPHICSHELPERES3_1_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp
index 3eac571a0..ce3f9ac42 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelperes3_2_p.h"
#include <QOpenGLExtraFunctions>
@@ -140,7 +104,7 @@ void GraphicsHelperES3_2::setVerticesPerPatch(GLint verticesPerPatch)
void GraphicsHelperES3_2::drawElementsInstancedBaseVertexBaseInstance(GLenum primitiveType, GLsizei primitiveCount, GLint indexType, void *indices, GLsizei instances, GLint baseVertex, GLint baseInstance)
{
if (baseInstance != 0)
- qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 2";
+ qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 3.2";
m_extraFuncs->glDrawElementsInstancedBaseVertex(primitiveType,
primitiveCount,
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2_p.h
index af289eaf6..403b8c6d1 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_2_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_2_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h
index 66c674421..8fc12ca6d 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 Svenn-Arne Dragly.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 Svenn-Arne Dragly.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERES3_H
@@ -76,6 +40,7 @@ public:
void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) override;
void drawBuffers(GLsizei n, const int *bufs) override;
void drawArraysInstanced(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances) override;
+ void drawArraysInstancedBaseInstance(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances, GLsizei baseInstance) override;
void drawElementsInstancedBaseVertexBaseInstance(GLenum primitiveType, GLsizei primitiveCount, GLint indexType, void *indices, GLsizei instances, GLint baseVertex = 0, GLint baseInstance = 0) override;
void readBuffer(GLenum mode) override;
void drawBuffer(GLenum mode) override;
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp
index e8213015f..0f7195fbd 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelpergl2_p.h"
#if !QT_CONFIG(opengles2)
@@ -882,8 +846,7 @@ UniformType GraphicsHelperGL2::uniformTypeFromGLType(GLenum type)
return UniformType::Sampler;
default:
- Q_UNREACHABLE();
- return UniformType::Float;
+ Q_UNREACHABLE_RETURN(UniformType::Float);
}
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h
index 24ddc72f7..6ec59eef2 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl2_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL2_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL2_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp
index 0eb0a9818..82b9c7542 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelpergl3_2_p.h"
@@ -99,7 +63,7 @@ void GraphicsHelperGL3_2::drawElementsInstancedBaseVertexBaseInstance(GLenum pri
GLint baseInstance)
{
if (baseInstance != 0)
- qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 2";
+ qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL 3.2";
// glDrawElements OpenGL 3.1 or greater
m_funcs->glDrawElementsInstancedBaseVertex(primitiveType,
@@ -1210,8 +1174,7 @@ UniformType GraphicsHelperGL3_2::uniformTypeFromGLType(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
return UniformType::Sampler;
default:
- Q_UNREACHABLE();
- return UniformType::Float;
+ Q_UNREACHABLE_RETURN(UniformType::Float);
}
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h
index 7cc5c838d..6adaf97e2 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL3_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL3_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp
index 370533197..c2802fae0 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelpergl3_3_p.h"
@@ -98,7 +62,7 @@ void GraphicsHelperGL3_3::drawElementsInstancedBaseVertexBaseInstance(GLenum pri
GLint baseInstance)
{
if (baseInstance != 0)
- qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL 3";
+ qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL 3.3";
// glDrawElements OpenGL 3.1 or greater
m_funcs->glDrawElementsInstancedBaseVertex(primitiveType,
@@ -1205,8 +1169,7 @@ UniformType GraphicsHelperGL3_3::uniformTypeFromGLType(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
return UniformType::Sampler;
default:
- Q_UNREACHABLE();
- return UniformType::Float;
+ Q_UNREACHABLE_RETURN(UniformType::Float);
}
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h
index c3f94d3d2..ba4f6c76e 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL3_3_P_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL3_3_P_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp
index 435ac7a03..c2dff740c 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "graphicshelpergl4_p.h"
@@ -121,7 +85,7 @@ namespace OpenGL {
namespace {
-GLbitfield memoryBarrierGLBitfield(QMemoryBarrier::Operations barriers)
+GLbitfield memoryBarrierGL4Bitfield(QMemoryBarrier::Operations barriers)
{
GLbitfield bits = 0;
@@ -187,16 +151,13 @@ void GraphicsHelperGL4::drawElementsInstancedBaseVertexBaseInstance(GLenum primi
GLint baseVertex,
GLint baseInstance)
{
- if (baseInstance != 0)
- qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 2";
-
- // glDrawElements OpenGL 3.1 or greater
- m_funcs->glDrawElementsInstancedBaseVertex(primitiveType,
+ m_funcs->glDrawElementsInstancedBaseVertexBaseInstance(primitiveType,
primitiveCount,
indexType,
indices,
instances,
- baseVertex);
+ baseVertex,
+ baseInstance);
}
void GraphicsHelperGL4::drawArraysInstanced(GLenum primitiveType,
@@ -709,8 +670,7 @@ UniformType GraphicsHelperGL4::uniformTypeFromGLType(GLenum type)
default:
// TO DO: Add support for Doubles and Images
- Q_UNREACHABLE();
- return UniformType::Float;
+ Q_UNREACHABLE_RETURN(UniformType::Float);
}
}
@@ -1346,7 +1306,7 @@ GLint GraphicsHelperGL4::maxClipPlaneCount()
void GraphicsHelperGL4::memoryBarrier(QMemoryBarrier::Operations barriers)
{
- m_funcs->glMemoryBarrier(memoryBarrierGLBitfield(barriers));
+ m_funcs->glMemoryBarrier(memoryBarrierGL4Bitfield(barriers));
}
void GraphicsHelperGL4::enablePrimitiveRestart(int primitiveRestartIndex)
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h
index 5941d8a52..a0ca9faa4 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL4_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERGL4_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h
index 6bfb363fc..ff9de8c59 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperinterface_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERINTERFACE_H
#define QT3DRENDER_RENDER_OPENGL_GRAPHICSHELPERINTERFACE_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpers.pri b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpers.pri
deleted file mode 100644
index 3cfa445ce..000000000
--- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpers.pri
+++ /dev/null
@@ -1,33 +0,0 @@
-#DEFINES += QT3D_RENDER_ASPECT_OPENGL_DEBUG
-
-INCLUDEPATH += $$PWD
-
-HEADERS += \
- $$PWD/graphicscontext_p.h \
- $$PWD/graphicshelperinterface_p.h \
- $$PWD/graphicshelperes2_p.h \
- $$PWD/graphicshelperes3_p.h \
- $$PWD/graphicshelperes3_1_p.h \
- $$PWD/graphicshelperes3_2_p.h \
- $$PWD/graphicshelpergl2_p.h \
- $$PWD/graphicshelpergl3_3_p.h \
- $$PWD/graphicshelpergl4_p.h \
- $$PWD/graphicshelpergl3_2_p.h \
- $$PWD/imagesubmissioncontext_p.h \
- $$PWD/submissioncontext_p.h \
- $$PWD/texturesubmissioncontext_p.h \
- $$PWD/qgraphicsutils_p.h
-
-SOURCES += \
- $$PWD/graphicscontext.cpp \
- $$PWD/graphicshelperes2.cpp \
- $$PWD/graphicshelperes3.cpp \
- $$PWD/graphicshelperes3_1.cpp \
- $$PWD/graphicshelperes3_2.cpp \
- $$PWD/graphicshelpergl2.cpp \
- $$PWD/graphicshelpergl3_3.cpp \
- $$PWD/graphicshelpergl4.cpp \
- $$PWD/graphicshelpergl3_2.cpp \
- $$PWD/imagesubmissioncontext.cpp \
- $$PWD/submissioncontext.cpp \
- $$PWD/texturesubmissioncontext.cpp
diff --git a/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext.cpp
index f641d6641..99364bac7 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "imagesubmissioncontext_p.h"
#include <Qt3DRender/private/shaderimage_p.h>
@@ -190,8 +154,7 @@ GLenum glImageFormatForShaderImageFormat(QShaderImage::ImageFormat format,
default:
qWarning() << "Cannot map Texture format" << textureFormat << "to a valid Image Format";
- Q_UNREACHABLE();
- return GL_NONE;
+ Q_UNREACHABLE_RETURN(GL_NONE);
}
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext_p.h b/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext_p.h
index 71e224942..f661c8a33 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/imagesubmissioncontext_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_IMAGESUBMISSIONCONTEXT_P_H
#define QT3DRENDER_RENDER_OPENGL_IMAGESUBMISSIONCONTEXT_P_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h b/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h
index 411c05d08..d10e9fa0e 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/qgraphicsutils_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_QGRAPHICSUTILS_P_H
#define QT3DRENDER_RENDER_OPENGL_QGRAPHICSUTILS_P_H
@@ -96,12 +60,7 @@ public:
static QVarLengthArray<char, 64> array(16 * byteSize);
memset(array.data(), 0, array.size());
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch (v.metaType().id()) {
-#else
- switch (v.type()) {
-#endif
-
// 1 byte
case QMetaType::Bool: {
T data = v.value<bool>();
@@ -336,11 +295,7 @@ public:
}
}
else
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.metaType().id();
-#else
- qWarning() << Q_FUNC_INFO << "QVariant type conversion not handled for " << v.type();
-#endif
break;
}
@@ -362,7 +317,7 @@ public:
QVariantList vList = v.toList();
// Handles list of QVariant: usually arrays of float
if (!vList.isEmpty()) {
- for (int i = 0; i < vList.length() && uint(i) * offset < uint(uniformValuesArray.size()); i++) {
+ for (int i = 0; i < vList.size() && uint(i) * offset < uint(uniformValuesArray.size()); i++) {
const char *subBuffer = QGraphicsUtils::bytesFromVariant<T>(vList.at(i));
memcpy(data + i * offset, subBuffer, offset);
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
index 4861390fe..eb1bd78b3 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "submissioncontext_p.h"
@@ -83,13 +47,9 @@
#include <QSurface>
#include <QWindow>
#include <QOpenGLTexture>
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#ifdef QT_OPENGL_LIB
#include <QtOpenGL/QOpenGLDebugLogger>
#endif
-#else
-#include <QOpenGLDebugLogger>
-#endif
QT_BEGIN_NAMESPACE
@@ -101,8 +61,6 @@ QT_BEGIN_NAMESPACE
#define GL_DRAW_FRAMEBUFFER 0x8CA9
#endif
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
namespace OpenGL {
@@ -123,14 +81,14 @@ unsigned int nextFreeContextId()
namespace {
-GLBuffer::Type attributeTypeToGLBufferType(QAttribute::AttributeType type)
+GLBuffer::Type attributeTypeToGLBufferType(Qt3DCore::QAttribute::AttributeType type)
{
switch (type) {
- case QAttribute::VertexAttribute:
+ case Qt3DCore::QAttribute::VertexAttribute:
return GLBuffer::ArrayBuffer;
- case QAttribute::IndexAttribute:
+ case Qt3DCore::QAttribute::IndexAttribute:
return GLBuffer::IndexBuffer;
- case QAttribute::DrawIndirectAttribute:
+ case Qt3DCore::QAttribute::DrawIndirectAttribute:
return GLBuffer::DrawIndirectBuffer;
default:
Q_UNREACHABLE();
@@ -376,8 +334,7 @@ GLint glAttachmentPoint(const QRenderTargetOutput::AttachmentPoint &attachmentPo
case QRenderTargetOutput::Stencil:
return GL_STENCIL_ATTACHMENT;
default:
- Q_UNREACHABLE();
- return GL_NONE;
+ Q_UNREACHABLE_RETURN(GL_NONE);
}
}
@@ -487,6 +444,10 @@ bool SubmissionContext::beginDrawing(QSurface *surface)
}
m_boundArrayBuffer = nullptr;
+
+ // Record the default FBO value as there's no guarantee it remains constant over time
+ m_defaultFBO = m_gl->defaultFramebufferObject();
+
return true;
}
@@ -503,7 +464,19 @@ void SubmissionContext::endDrawing(bool swapBuffers)
void SubmissionContext::activateRenderTarget(Qt3DCore::QNodeId renderTargetNodeId, const AttachmentPack &attachments, GLuint defaultFboId)
{
GLuint fboId = defaultFboId; // Default FBO
- if (renderTargetNodeId) {
+ resolveRenderTargetFormat(); // Reset m_renderTargetFormat based on the default FBO
+
+ // check if target buffer is GL_BACK_LEFT or GL_BACK_RIGHT, as they don't need an
+ // own fbo
+ auto allLeftOrRight = std::all_of(attachments.attachments().begin(), attachments.attachments().end(),
+ [](const Attachment& att){
+ return att.m_point == QRenderTargetOutput::Left || att.m_point == QRenderTargetOutput::Right;
+ });
+
+ const bool allAttachmentsAreLeftOrRight = attachments.attachments().size() > 0 && allLeftOrRight;
+ const bool shouldCreateRenderTarget = !allAttachmentsAreLeftOrRight && renderTargetNodeId;
+
+ if (shouldCreateRenderTarget) {
// New RenderTarget
if (!m_renderTargets.contains(renderTargetNodeId)) {
if (m_defaultFBO && fboId == m_defaultFBO) {
@@ -513,9 +486,10 @@ void SubmissionContext::activateRenderTarget(Qt3DCore::QNodeId renderTargetNodeI
fboId = createRenderTarget(renderTargetNodeId, attachments);
}
} else {
- fboId = updateRenderTarget(renderTargetNodeId, attachments, true);
+ fboId = updateRenderTarget(renderTargetNodeId, attachments, true); // Overwrites m_renderTargetFormat based on custom FBO
}
}
+
m_activeFBO = fboId;
m_activeFBONodeId = renderTargetNodeId;
m_glHelper->bindFrameBufferObject(m_activeFBO, GraphicsHelperInterface::FBODraw);
@@ -645,6 +619,7 @@ QImage SubmissionContext::readFramebuffer(const QRect &rect)
QImage::Format imageFormat;
uint stride;
+ // m_renderTargetFormat is set when the current RV FBO is set in activateRenderTarget
/* format value should match GL internalFormat */
GLenum internalFormat = m_renderTargetFormat;
@@ -893,6 +868,9 @@ void SubmissionContext::activateDrawBuffers(const AttachmentPack &attachments)
m_glHelper->drawBuffers(GLsizei(activeDrawBuffers.size()), activeDrawBuffers.data());
}
}
+ else if (activeDrawBuffers.size() == 1){
+ m_glHelper->drawBuffer(activeDrawBuffers.at(0));
+ }
} else {
qCWarning(Backend) << "FBO incomplete";
}
@@ -1262,6 +1240,10 @@ bool SubmissionContext::setParameters(ShaderParameterPack &parameterPack, GLShad
}
}
+ // Set the pinned images of the previous material
+ // to pinable so that we should easily find an available image unit
+ m_imageContext.deactivateImages();
+
// Fill Image Uniform Value with proper image units
// so that they can be applied as regular uniforms in a second step
for (size_t i = 0; i < parameterPack.images().size(); ++i) {
@@ -1526,7 +1508,7 @@ void SubmissionContext::uploadDataToGLBuffer(Buffer *buffer, GLBuffer *b, bool r
// We have a partial update
if (update->offset >= 0) {
//accumulate sequential updates as single one
- int bufferSize = update->data.size();
+ qsizetype bufferSize = update->data.size();
auto it2 = it + 1;
while ((it2 != updates.end())
&& (it2->offset - update->offset == bufferSize)) {
@@ -1546,7 +1528,7 @@ void SubmissionContext::uploadDataToGLBuffer(Buffer *buffer, GLBuffer *b, bool r
// We have an update that was done by calling QBuffer::setData
// which is used to resize or entirely clear the buffer
// Note: we use the buffer data directly in that case
- const int bufferSize = buffer->data().size();
+ const qsizetype bufferSize = buffer->data().size();
b->allocate(this, bufferSize, false); // orphan the buffer
b->allocate(this, buffer->data().constData(), bufferSize, false);
}
diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
index 5cbfe540d..36ee8ab8e 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext_p.h
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_SUBMISSIONCONTEXT_H
#define QT3DRENDER_RENDER_OPENGL_SUBMISSIONCONTEXT_H
diff --git a/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext.cpp
index 1650f8563..828f19cfa 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext.cpp
+++ b/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "texturesubmissioncontext_p.h"
diff --git a/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext_p.h b/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext_p.h
index 70cc44c21..a6c71f934 100644
--- a/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext_p.h
+++ b/src/plugins/renderers/opengl/graphicshelpers/texturesubmissioncontext_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_TEXTURESUBMISSIONCONTEXT_H
#define QT3DRENDER_RENDER_OPENGL_TEXTURESUBMISSIONCONTEXT_H
diff --git a/src/plugins/renderers/opengl/io/glbuffer.cpp b/src/plugins/renderers/opengl/io/glbuffer.cpp
index 27f005f01..94906affd 100644
--- a/src/plugins/renderers/opengl/io/glbuffer.cpp
+++ b/src/plugins/renderers/opengl/io/glbuffer.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "glbuffer_p.h"
#include <graphicscontext_p.h>
diff --git a/src/plugins/renderers/opengl/io/glbuffer_p.h b/src/plugins/renderers/opengl/io/glbuffer_p.h
index 6a2daa287..210b29252 100644
--- a/src/plugins/renderers/opengl/io/glbuffer_p.h
+++ b/src/plugins/renderers/opengl/io/glbuffer_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GLBUFFER_P_H
#define QT3DRENDER_RENDER_OPENGL_GLBUFFER_P_H
diff --git a/src/plugins/renderers/opengl/io/io.pri b/src/plugins/renderers/opengl/io/io.pri
deleted file mode 100644
index 462978c4d..000000000
--- a/src/plugins/renderers/opengl/io/io.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-INCLUDEPATH += $$PWD
-
-SOURCES += \
- $$PWD/glbuffer.cpp
-
-HEADERS += \
- $$PWD/glbuffer_p.h
-
diff --git a/src/plugins/renderers/opengl/main.cpp b/src/plugins/renderers/opengl/main.cpp
index 7f982ef8e..35414f6cf 100644
--- a/src/plugins/renderers/opengl/main.cpp
+++ b/src/plugins/renderers/opengl/main.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <Qt3DRender/private/qrendererplugin_p.h>
#include <renderer_p.h>
diff --git a/src/plugins/renderers/opengl/managers/gl_handle_types_p.h b/src/plugins/renderers/opengl/managers/gl_handle_types_p.h
index 98af4d3b8..298b7e02b 100644
--- a/src/plugins/renderers/opengl/managers/gl_handle_types_p.h
+++ b/src/plugins/renderers/opengl/managers/gl_handle_types_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_HANDLE_TYPES_P_H
#define QT3DRENDER_RENDER_OPENGL_HANDLE_TYPES_P_H
diff --git a/src/plugins/renderers/opengl/managers/glresourcemanagers.cpp b/src/plugins/renderers/opengl/managers/glresourcemanagers.cpp
index e8fd893ee..a57e66e94 100644
--- a/src/plugins/renderers/opengl/managers/glresourcemanagers.cpp
+++ b/src/plugins/renderers/opengl/managers/glresourcemanagers.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "glresourcemanagers_p.h"
diff --git a/src/plugins/renderers/opengl/managers/glresourcemanagers_p.h b/src/plugins/renderers/opengl/managers/glresourcemanagers_p.h
index f6dc3e2d1..588b26362 100644
--- a/src/plugins/renderers/opengl/managers/glresourcemanagers_p.h
+++ b/src/plugins/renderers/opengl/managers/glresourcemanagers_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GLRESOURCEMANAGERS_P_H
#define QT3DRENDER_RENDER_OPENGL_GLRESOURCEMANAGERS_P_H
diff --git a/src/plugins/renderers/opengl/managers/managers.pri b/src/plugins/renderers/opengl/managers/managers.pri
deleted file mode 100644
index 97a4c2c45..000000000
--- a/src/plugins/renderers/opengl/managers/managers.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-INCLUDEPATH += $$PWD
-
-HEADERS += \
- $$PWD/gl_handle_types_p.h \
- $$PWD/glresourcemanagers_p.h
-
-SOURCES += \
- $$PWD/glresourcemanagers.cpp
diff --git a/src/plugins/renderers/opengl/opengl.cmake b/src/plugins/renderers/opengl/opengl.cmake
index 2eb35f6d9..1345a653b 100644
--- a/src/plugins/renderers/opengl/opengl.cmake
+++ b/src/plugins/renderers/opengl/opengl.cmake
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
function(qt3d_setup_opengl_renderer_target target)
set(glplugindir ${PROJECT_SOURCE_DIR}/src/plugins/renderers/opengl)
diff --git a/src/plugins/renderers/opengl/opengl.pri b/src/plugins/renderers/opengl/opengl.pri
deleted file mode 100644
index 4308992e5..000000000
--- a/src/plugins/renderers/opengl/opengl.pri
+++ /dev/null
@@ -1,41 +0,0 @@
-QT += core-private gui-private 3dcore 3dcore-private 3drender 3drender-private opengl-private
-
-CONFIG += c++17
-
-# Qt3D is free of Q_FOREACH - make sure it stays that way:
-DEFINES += QT_NO_FOREACH
-DEFINES += BUILD_QT3D_MODULE
-
-# For Q_AUTOTEST_EXPORT to work
-DEFINES += QT_BUILDING_QT
-
-DISTFILES += \
- openglrenderer.json
-
-include (renderer/renderer.pri)
-include (io/io.pri)
-include (textures/textures.pri)
-include (graphicshelpers/graphicshelpers.pri)
-include (managers/managers.pri)
-
-!integrity: include (debug/debug.pri)
-
-INCLUDEPATH += $$PWD
-
-# Qt3D is free of Q_FOREACH - make sure it stays that way:
-DEFINES += QT_NO_FOREACH
-
-gcov {
- QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
- QMAKE_LFLAGS += -fprofile-arcs -ftest-coverage
-}
-
-qtConfig(qt3d-simd-avx2) {
- CONFIG += simd
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_AVX2
-}
-
-qtConfig(qt3d-simd-sse2):!qtConfig(qt3d-simd-avx2) {
- CONFIG += simd
- QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_SSE2
-}
diff --git a/src/plugins/renderers/opengl/opengl.pro b/src/plugins/renderers/opengl/opengl.pro
deleted file mode 100644
index f098513e8..000000000
--- a/src/plugins/renderers/opengl/opengl.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TARGET = openglrenderer
-
-# We use QT_AUTOTEST_EXPORT to test the plug-ins, which needs QT_BUILDING_QT
-DEFINES += QT_BUILDING_QT
-
-include(opengl.pri)
-
-SOURCES += \
- main.cpp
-
-PLUGIN_TYPE = renderers
-PLUGIN_CLASS_NAME = OpenGLRendererPlugin
-load(qt_plugin)
diff --git a/src/plugins/renderers/opengl/renderer/commandexecuter.cpp b/src/plugins/renderers/opengl/renderer/commandexecuter.cpp
index edc492826..27697142f 100644
--- a/src/plugins/renderers/opengl/renderer/commandexecuter.cpp
+++ b/src/plugins/renderers/opengl/renderer/commandexecuter.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "commandexecuter_p.h"
@@ -306,7 +270,7 @@ void CommandExecuter::performAsynchronousCommandExecution(const std::vector<Rend
QVariant CommandExecuter::executeCommand(const QStringList &args)
{
// Note: The replies will be deleted by the AspectCommandDebugger
- if (args.length() > 0 &&
+ if (args.size() > 0 &&
(args.first() == QLatin1String("glinfo") ||
args.first() == QLatin1String("rendercommands"))) {
auto reply = new Qt3DCore::Debug::AsynchronousCommandReply(args.first());
diff --git a/src/plugins/renderers/opengl/renderer/commandexecuter_p.h b/src/plugins/renderers/opengl/renderer/commandexecuter_p.h
index dd1aa813a..3389d3376 100644
--- a/src/plugins/renderers/opengl/renderer/commandexecuter_p.h
+++ b/src/plugins/renderers/opengl/renderer/commandexecuter_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Paul Lemire <paul.lemire350@gmail.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_DEBUG_COMMANDEXECUTER_H
#define QT3DRENDER_DEBUG_COMMANDEXECUTER_H
diff --git a/src/plugins/renderers/opengl/renderer/frameprofiler_p.h b/src/plugins/renderers/opengl/renderer/frameprofiler_p.h
index 99d544da2..11da771fb 100644
--- a/src/plugins/renderers/opengl/renderer/frameprofiler_p.h
+++ b/src/plugins/renderers/opengl/renderer/frameprofiler_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_FRAMEPROFILER_P_H
#define QT3DRENDER_RENDER_FRAMEPROFILER_P_H
@@ -157,8 +121,8 @@ public:
Qt3DCore::QSystemInformationServicePrivate *dservice = Qt3DCore::QSystemInformationServicePrivate::get(m_service);
- int j = 0;
- for (int i = 0, m = m_recordings.size(); i < m; ++i) {
+ qsizetype j = 0;
+ for (qsizetype i = 0, m = m_recordings.size(); i < m; ++i) {
const GLRecording rec = m_recordings.at(i);
Qt3DCore::QSystemInformationServicePrivate::JobRunStats glRecordingStat;
diff --git a/src/plugins/renderers/opengl/renderer/glfence_p.h b/src/plugins/renderers/opengl/renderer/glfence_p.h
index 366065048..13db95a80 100644
--- a/src/plugins/renderers/opengl/renderer/glfence_p.h
+++ b/src/plugins/renderers/opengl/renderer/glfence_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef GLFENCE_P_H
#define GLFENCE_P_H
diff --git a/src/plugins/renderers/opengl/renderer/gllights.cpp b/src/plugins/renderers/opengl/renderer/gllights.cpp
index c87fd766b..071d43b4f 100644
--- a/src/plugins/renderers/opengl/renderer/gllights.cpp
+++ b/src/plugins/renderers/opengl/renderer/gllights.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <Qt3DRender/private/stringtoint_p.h>
#include "gllights_p.h"
diff --git a/src/plugins/renderers/opengl/renderer/gllights_p.h b/src/plugins/renderers/opengl/renderer/gllights_p.h
index 90fa91588..56c29bc73 100644
--- a/src/plugins/renderers/opengl/renderer/gllights_p.h
+++ b/src/plugins/renderers/opengl/renderer/gllights_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2020 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GLLIGHTS_P_H
#define QT3DRENDER_RENDER_OPENGL_GLLIGHTS_P_H
diff --git a/src/plugins/renderers/opengl/renderer/glshader.cpp b/src/plugins/renderers/opengl/renderer/glshader.cpp
index ce0a9deb0..fdd2a710c 100644
--- a/src/plugins/renderers/opengl/renderer/glshader.cpp
+++ b/src/plugins/renderers/opengl/renderer/glshader.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "glshader_p.h"
#include <QMutexLocker>
@@ -115,6 +79,7 @@ void GLShader::setGraphicsContext(GraphicsContext *context)
if (m_graphicsContext) {
m_contextConnection = QObject::connect(m_graphicsContext->openGLContext(),
&QOpenGLContext::aboutToBeDestroyed,
+ m_graphicsContext->openGLContext(),
[this] { setGraphicsContext(nullptr); });
}
}
@@ -236,7 +201,7 @@ void GLShader::prepareUniforms(ShaderParameterPack &pack)
auto it = values.keys.cbegin();
const auto end = values.keys.cend();
- const int shaderUniformsCount = m_uniforms.size();
+ const int shaderUniformsCount = int(m_uniforms.size());
const auto uIt = m_uniforms.cbegin();
while (it != end) {
@@ -325,7 +290,7 @@ void GLShader::initializeUniforms(const std::vector<ShaderUniform> &uniformsDesc
}
m_uniformBlockIndexToShaderUniforms.insert(-1, activeUniformsInDefaultBlock);
- m_parameterPackSize += m_standardUniformNamesIds.size() + m_lightUniformsNamesIds.size() + m_uniformsNamesIds.size();
+ m_parameterPackSize += int(m_standardUniformNamesIds.size()) + int(m_lightUniformsNamesIds.size()) + int(m_uniformsNamesIds.size());
m_hasActiveVariables |= (m_parameterPackSize > 0);
// Sort by ascending order to make contains check faster
@@ -343,7 +308,7 @@ void GLShader::initializeAttributes(const std::vector<ShaderAttribute> &attribut
m_attributes = attributesDescription;
m_attributesNames.resize(attributesDescription.size());
m_attributeNamesIds.resize(attributesDescription.size());
- for (int i = 0, m = attributesDescription.size(); i < m; i++) {
+ for (int i = 0, m = int(attributesDescription.size()); i < m; i++) {
m_attributesNames[i] = attributesDescription[i].m_name;
m_attributes[i].m_nameId = StringToInt::lookupId(m_attributesNames[i]);
m_attributeNamesIds[i] = m_attributes[i].m_nameId;
@@ -357,7 +322,7 @@ void GLShader::initializeUniformBlocks(const std::vector<ShaderUniformBlock> &un
m_uniformBlocks = uniformBlockDescription;
m_uniformBlockNames.resize(uniformBlockDescription.size());
m_uniformBlockNamesIds.resize(uniformBlockDescription.size());
- for (int i = 0, m = uniformBlockDescription.size(); i < m; ++i) {
+ for (int i = 0, m = int(uniformBlockDescription.size()); i < m; ++i) {
m_uniformBlockNames[i] = m_uniformBlocks[i].m_name;
m_uniformBlockNamesIds[i] = StringToInt::lookupId(m_uniformBlockNames[i]);
m_uniformBlocks[i].m_nameId = m_uniformBlockNamesIds[i];
@@ -386,7 +351,7 @@ void GLShader::initializeUniformBlocks(const std::vector<ShaderUniformBlock> &un
m_uniformBlockIndexToShaderUniforms.insert(uniformBlockDescription[i].m_index, activeUniformsInBlock);
}
- m_parameterPackSize += m_uniformsNamesIds.size();
+ m_parameterPackSize += int(m_uniformsNamesIds.size());
m_hasActiveVariables |= (m_parameterPackSize > 0);
// Sort by ascending order to make contains check faster
@@ -399,14 +364,14 @@ void GLShader::initializeShaderStorageBlocks(const std::vector<ShaderStorageBloc
m_shaderStorageBlockNames.resize(shaderStorageBlockDescription.size());
m_shaderStorageBlockNamesIds.resize(shaderStorageBlockDescription.size());
- for (int i = 0, m = shaderStorageBlockDescription.size(); i < m; ++i) {
+ for (int i = 0, m = int(shaderStorageBlockDescription.size()); i < m; ++i) {
m_shaderStorageBlockNames[i] = m_shaderStorageBlocks[i].m_name;
m_shaderStorageBlockNamesIds[i] = StringToInt::lookupId(m_shaderStorageBlockNames[i]);
m_shaderStorageBlocks[i].m_nameId =m_shaderStorageBlockNamesIds[i];
qCDebug(Shaders) << "Initializing Shader Storage Block {" << m_shaderStorageBlockNames[i] << "}";
}
- m_parameterPackSize += m_shaderStorageBlockNamesIds.size();
+ m_parameterPackSize += int(m_shaderStorageBlockNamesIds.size());
m_hasActiveVariables |= (m_parameterPackSize > 0);
// Sort by ascending order to make contains check faster
diff --git a/src/plugins/renderers/opengl/renderer/glshader_p.h b/src/plugins/renderers/opengl/renderer/glshader_p.h
index 7cc34bd9c..091d8c2b7 100644
--- a/src/plugins/renderers/opengl/renderer/glshader_p.h
+++ b/src/plugins/renderers/opengl/renderer/glshader_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GLSHADER_P_H
#define QT3DRENDER_RENDER_OPENGL_GLSHADER_P_H
diff --git a/src/plugins/renderers/opengl/renderer/logging.cpp b/src/plugins/renderers/opengl/renderer/logging.cpp
index 0d6ef1211..6ab79cd5a 100644
--- a/src/plugins/renderers/opengl/renderer/logging.cpp
+++ b/src/plugins/renderers/opengl/renderer/logging.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "logging_p.h"
diff --git a/src/plugins/renderers/opengl/renderer/logging_p.h b/src/plugins/renderers/opengl/renderer/logging_p.h
index 69c125195..b42e55cfd 100644
--- a/src/plugins/renderers/opengl/renderer/logging_p.h
+++ b/src/plugins/renderers/opengl/renderer/logging_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_RENDERLOGGING_P_H
#define QT3DRENDER_RENDER_OPENGL_RENDERLOGGING_P_H
diff --git a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp
index 45779541e..6f3f7b259 100644
--- a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp
+++ b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "openglvertexarrayobject_p.h"
#include <submissioncontext_p.h>
@@ -152,9 +116,10 @@ void OpenGLVertexArrayObject::saveVertexAttribute(const SubmissionContext::VAOVe
// Remove any vertexAttribute already at location
m_vertexAttributes.erase(std::remove_if(m_vertexAttributes.begin(),
m_vertexAttributes.end(),
- [attr] (const SubmissionContext::VAOVertexAttribute &a) {
- return a.location == attr.location;
- }));
+ [attr](const SubmissionContext::VAOVertexAttribute &a) {
+ return a.location == attr.location;
+ }),
+ m_vertexAttributes.end());
m_vertexAttributes.push_back(attr);
}
diff --git a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h
index f2d690e6d..80e9eee34 100644
--- a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h
+++ b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_OPENGLVERTEXARRAYOBJECT_H
#define QT3DRENDER_RENDER_OPENGL_OPENGLVERTEXARRAYOBJECT_H
diff --git a/src/plugins/renderers/opengl/renderer/rendercommand.cpp b/src/plugins/renderers/opengl/renderer/rendercommand.cpp
index d4da1a41b..8739ddfdb 100644
--- a/src/plugins/renderers/opengl/renderer/rendercommand.cpp
+++ b/src/plugins/renderers/opengl/renderer/rendercommand.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "rendercommand_p.h"
diff --git a/src/plugins/renderers/opengl/renderer/rendercommand_p.h b/src/plugins/renderers/opengl/renderer/rendercommand_p.h
index 09ed04855..e8b056c26 100644
--- a/src/plugins/renderers/opengl/renderer/rendercommand_p.h
+++ b/src/plugins/renderers/opengl/renderer/rendercommand_p.h
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_RENDERCOMMAND_H
#define QT3DRENDER_RENDER_OPENGL_RENDERCOMMAND_H
diff --git a/src/plugins/renderers/opengl/renderer/renderer.cpp b/src/plugins/renderers/opengl/renderer/renderer.cpp
index aaec6ad7b..fa2d27486 100644
--- a/src/plugins/renderers/opengl/renderer/renderer.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderer.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "renderer_p.h"
@@ -126,8 +90,6 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
namespace OpenGL {
@@ -358,7 +320,7 @@ void Renderer::setNodeManagers(NodeManagers *managers)
m_computableEntityFilterJob->setManager(m_nodesManager->renderNodesManager());
}
-void Renderer::setServices(QServiceLocator *services)
+void Renderer::setServices(Qt3DCore::QServiceLocator *services)
{
m_services = services;
@@ -475,12 +437,12 @@ void Renderer::initialize()
qCWarning(Backend) << Q_FUNC_INFO << "OpenGL context creation failed";
m_ownedContext = true;
- QObject::connect(m_glContext, &QOpenGLContext::aboutToBeDestroyed,
+ QObject::connect(m_glContext, &QOpenGLContext::aboutToBeDestroyed, m_glContext,
[this] { m_frameProfiler.reset(); });
} else {
// Context is not owned by us, so we need to know if it gets destroyed
m_contextConnection = QObject::connect(m_glContext, &QOpenGLContext::aboutToBeDestroyed,
- [this] { releaseGraphicsResources(); });
+ m_glContext, [this] { releaseGraphicsResources(); });
}
qCDebug(Backend) << "Qt3D shared context:" << m_glContext->shareContext();
@@ -714,12 +676,12 @@ void Renderer::render(bool swapBuffers)
// RenderQueue is complete (but that means it may be of size 0)
if (!queueIsEmpty) {
- QTaskLogger submissionStatsPart1(m_services->systemInformation(),
- {JobTypes::FrameSubmissionPart1, 0},
- QTaskLogger::Submission);
- QTaskLogger submissionStatsPart2(m_services->systemInformation(),
- {JobTypes::FrameSubmissionPart2, 0},
- QTaskLogger::Submission);
+ Qt3DCore::QTaskLogger submissionStatsPart1(m_services->systemInformation(),
+ { JobTypes::FrameSubmissionPart1, 0 },
+ Qt3DCore::QTaskLogger::Submission);
+ Qt3DCore::QTaskLogger submissionStatsPart2(m_services->systemInformation(),
+ { JobTypes::FrameSubmissionPart2, 0 },
+ Qt3DCore::QTaskLogger::Submission);
{ // Scoped to destroy surfaceLock
QSurface *surface = nullptr;
for (const RenderView *rv: renderViews) {
@@ -1015,10 +977,10 @@ void Renderer::lookForDirtyTextures()
const std::vector<HTexture> &activeTextureHandles = textureManager->activeHandles();
for (const HTexture &handle: activeTextureHandles) {
Texture *texture = textureManager->data(handle);
- const QNodeIdVector imageIds = texture->textureImageIds();
+ const Qt3DCore::QNodeIdVector imageIds = texture->textureImageIds();
// Does the texture reference any of the dirty texture images?
- for (const QNodeId &imageId: imageIds) {
+ for (const Qt3DCore::QNodeId &imageId : imageIds) {
if (dirtyImageIds.contains(imageId)) {
texture->addDirtyFlag(Texture::DirtyImageGenerators);
break;
@@ -1046,7 +1008,7 @@ void Renderer::reloadDirtyShaders()
// If api of the renderer matches the one from the technique
if (technique->isCompatibleWithRenderer()) {
const auto passIds = technique->renderPasses();
- for (const QNodeId &passId : passIds) {
+ for (const Qt3DCore::QNodeId &passId : passIds) {
RenderPass *renderPass = m_nodesManager->renderPassManager()->lookupResource(passId);
HShader shaderHandle = m_nodesManager->shaderManager()->lookupHandle(renderPass->shaderProgram());
Shader *shader = m_nodesManager->shaderManager()->data(shaderHandle);
@@ -1100,13 +1062,16 @@ void Renderer::sendShaderChangesToFrontend(Qt3DCore::QAspectManager *manager)
const std::vector<HShader> &activeShaders = m_nodesManager->shaderManager()->activeHandles();
for (const HShader &handle :activeShaders) {
Shader *s = m_nodesManager->shaderManager()->data(handle);
+ if (!s)
+ continue;
+
if (s->requiresFrontendSync()) {
QShaderProgram *frontend = static_cast<decltype(frontend)>(manager->lookupNode(s->peerId()));
// Could happen as a backend shader might live beyong the frontend
// the time needed to destroy the GLShader assoicated with it.
if (!frontend)
continue;
- QShaderProgramPrivate *dFrontend = static_cast<decltype(dFrontend)>(QNodePrivate::get(frontend));
+ QShaderProgramPrivate *dFrontend = static_cast<decltype(dFrontend)>(Qt3DCore::QNodePrivate::get(frontend));
s->unsetRequiresFrontendSync();
dFrontend->setStatus(s->status());
dFrontend->setLog(s->log());
@@ -1117,7 +1082,7 @@ void Renderer::sendShaderChangesToFrontend(Qt3DCore::QAspectManager *manager)
const std::vector<ShaderBuilderUpdate> shaderBuilderUpdates = Qt3DCore::moveAndClear(m_shaderBuilderUpdates);
for (const ShaderBuilderUpdate &update : shaderBuilderUpdates) {
QShaderProgramBuilder *builder = static_cast<decltype(builder)>(manager->lookupNode(update.builderId));
- QShaderProgramBuilderPrivate *dBuilder = static_cast<decltype(dBuilder)>(QNodePrivate::get(builder));
+ QShaderProgramBuilderPrivate *dBuilder = static_cast<decltype(dBuilder)>(Qt3DCore::QNodePrivate::get(builder));
dBuilder->setShaderCode(update.shaderCode, update.shaderType);
}
}
@@ -1149,7 +1114,7 @@ void Renderer::sendTextureChangesToFrontend(Qt3DCore::QAspectManager *manager)
texture->setFormat(properties.format);
texture->blockNotifications(blocked);
- QAbstractTexturePrivate *dTexture = static_cast<QAbstractTexturePrivate *>(QNodePrivate::get(texture));
+ QAbstractTexturePrivate *dTexture = static_cast<QAbstractTexturePrivate *>(Qt3DCore::QNodePrivate::get(texture));
dTexture->setStatus(properties.status);
dTexture->setHandleType(pair.first.handleType);
@@ -1168,7 +1133,7 @@ void Renderer::sendSetFenceHandlesToFrontend(Qt3DCore::QAspectManager *manager)
if (fgNode != nullptr) { // Node could have been deleted before we got a chance to notify it
Q_ASSERT(fgNode->nodeType() == FrameGraphNode::SetFence);
QSetFence *frontend = static_cast<decltype(frontend)>(manager->lookupNode(fgNode->peerId()));
- QSetFencePrivate *dFrontend = static_cast<decltype(dFrontend)>(QNodePrivate::get(frontend));
+ QSetFencePrivate *dFrontend = static_cast<decltype(dFrontend)>(Qt3DCore::QNodePrivate::get(frontend));
dFrontend->setHandleType(QSetFence::OpenGLFenceId);
dFrontend->setHandle(QVariant::fromValue(pair.second));
}
@@ -1300,7 +1265,7 @@ void Renderer::updateGLResources()
// We want to upload textures data at this point as the SubmissionThread and
// AspectThread are locked ensuring no races between Texture/TextureImage and
// GLTexture
- QNodeIdVector updatedTexturesForFrame;
+ Qt3DCore::QNodeIdVector updatedTexturesForFrame;
if (m_submissionContext != nullptr) {
GLTextureManager *glTextureManager = m_glResourceManagers->glTextureManager();
const std::vector<HGLTexture> &glTextureHandles = glTextureManager->activeHandles();
@@ -1314,7 +1279,7 @@ void Renderer::updateGLResources()
// GLTexture creation provides us width/height/format ... information
// for textures which had not initially specified these information (TargetAutomatic...)
// Gather these information and store them to be distributed by a change next frame
- const QNodeIdVector referenceTextureIds = { glTextureManager->texNodeIdForGLTexture.value(glTexture) };
+ const Qt3DCore::QNodeIdVector referenceTextureIds = { glTextureManager->texNodeIdForGLTexture.value(glTexture) };
// Store properties and referenceTextureIds
if (info.wasUpdated) {
Texture::TextureUpdateInfo updateInfo;
@@ -1340,7 +1305,7 @@ void Renderer::updateGLResources()
// Remove destroyed FBOs
{
- const QNodeIdVector destroyedRenderTargetIds = m_nodesManager->renderTargetManager()->takeRenderTargetIdsToCleanup();
+ const Qt3DCore::QNodeIdVector destroyedRenderTargetIds = m_nodesManager->renderTargetManager()->takeRenderTargetIdsToCleanup();
for (const Qt3DCore::QNodeId &renderTargetId : destroyedRenderTargetIds)
m_submissionContext->releaseRenderTarget(renderTargetId);
}
@@ -1382,11 +1347,11 @@ void Renderer::updateTexture(Texture *texture)
// Will make the texture requestUpload
if (dirtyFlags.testFlag(Texture::DirtyImageGenerators)) {
- const QNodeIdVector textureImageIds = texture->textureImageIds();
+ const Qt3DCore::QNodeIdVector textureImageIds = texture->textureImageIds();
std::vector<GLTexture::Image> images;
images.reserve(textureImageIds.size());
// TODO: Move this into GLTexture directly
- for (const QNodeId &textureImageId : textureImageIds) {
+ for (const Qt3DCore::QNodeId &textureImageId : textureImageIds) {
const TextureImage *img = m_nodesManager->textureImageManager()->lookupResource(textureImageId);
if (img == nullptr) {
qWarning() << Q_FUNC_INFO << "invalid TextureImage handle";
@@ -1642,7 +1607,8 @@ Renderer::ViewSubmissionResultData Renderer::submitRenderViews(const std::vector
Render::RenderCapture *renderCapture =
static_cast<Render::RenderCapture*>(m_nodesManager->frameGraphManager()->lookupNode(renderView->renderCaptureNodeId()));
renderCapture->addRenderCapture(request.captureId, image);
- const QNodeId renderCaptureId = renderView->renderCaptureNodeId();
+ const Qt3DCore::QNodeId renderCaptureId = renderView->renderCaptureNodeId();
+ QMutexLocker lock(&m_pendingRenderCaptureSendRequestsMutex);
if (!Qt3DCore::contains(m_pendingRenderCaptureSendRequests, renderCaptureId))
m_pendingRenderCaptureSendRequests.push_back(renderView->renderCaptureNodeId());
}
@@ -1653,8 +1619,8 @@ Renderer::ViewSubmissionResultData Renderer::submitRenderViews(const std::vector
// Perform BlitFramebuffer operations
if (renderView->hasBlitFramebufferInfo()) {
const auto &blitFramebufferInfo = renderView->blitFrameBufferInfo();
- const QNodeId inputTargetId = blitFramebufferInfo.sourceRenderTargetId;
- const QNodeId outputTargetId = blitFramebufferInfo.destinationRenderTargetId;
+ const Qt3DCore::QNodeId inputTargetId = blitFramebufferInfo.sourceRenderTargetId;
+ const Qt3DCore::QNodeId outputTargetId = blitFramebufferInfo.destinationRenderTargetId;
const QRect inputRect = blitFramebufferInfo.sourceRect;
const QRect outputRect = blitFramebufferInfo.destinationRect;
const QRenderTargetOutput::AttachmentPoint inputAttachmentPoint = blitFramebufferInfo.sourceAttachmentPoint;
@@ -1753,7 +1719,9 @@ void Renderer::jobsDone(Qt3DCore::QAspectManager *manager)
// called in main thread once all jobs are done running
// sync captured renders to frontend
+ QMutexLocker lock(&m_pendingRenderCaptureSendRequestsMutex);
const std::vector<Qt3DCore::QNodeId> pendingCaptureIds = Qt3DCore::moveAndClear(m_pendingRenderCaptureSendRequests);
+ lock.unlock();
for (const Qt3DCore::QNodeId &id : pendingCaptureIds) {
auto *backend = static_cast<Qt3DRender::Render::RenderCapture *>
(m_nodesManager->frameGraphManager()->lookupNode(id));
@@ -1791,7 +1759,7 @@ bool Renderer::processKeyEvent(QObject *object, QKeyEvent *event)
}
// Jobs we may have to run even if no rendering will happen
-std::vector<QAspectJobPtr> Renderer::preRenderingJobs()
+std::vector<Qt3DCore::QAspectJobPtr> Renderer::preRenderingJobs()
{
if (m_sendBufferCaptureJob->hasRequests())
return {m_sendBufferCaptureJob};
@@ -1804,10 +1772,10 @@ std::vector<QAspectJobPtr> Renderer::preRenderingJobs()
// for the rendering of the scene
std::vector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs()
{
- std::vector<QAspectJobPtr> renderBinJobs;
+ std::vector<Qt3DCore::QAspectJobPtr> renderBinJobs;
// Remove previous dependencies
- m_cleanupJob->removeDependency(QWeakPointer<QAspectJob>());
+ m_cleanupJob->removeDependency(QWeakPointer<Qt3DCore::QAspectJob>());
const bool dirtyParametersForCurrentFrame = m_dirtyBits.marked & AbstractRenderer::ParameterDirty;
const BackendNodeDirtySet dirtyBitsForFrame = m_dirtyBits.marked | m_dirtyBits.remaining;
@@ -1878,7 +1846,7 @@ std::vector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs()
m_updatedDisableSubtreeEnablers.push_back(node->peerId());
}
- int idealThreadCount = QAspectJobManager::idealThreadCount();
+ int idealThreadCount = Qt3DCore::QAspectJobManager::idealThreadCount();
const size_t fgBranchCount = m_frameGraphLeaves.size();
if (fgBranchCount > 1) {
@@ -1933,7 +1901,7 @@ std::vector<Qt3DCore::QAspectJobPtr> Renderer::renderBinJobs()
return renderBinJobs;
}
-QAbstractFrameAdvanceService *Renderer::frameAdvanceService() const
+Qt3DCore::QAbstractFrameAdvanceService *Renderer::frameAdvanceService() const
{
return static_cast<Qt3DCore::QAbstractFrameAdvanceService *>(m_vsyncFrameAdvanceService.data());
}
@@ -2169,7 +2137,7 @@ bool Renderer::updateVAOWithAttributes(Geometry *geometry,
m_dirtyAttributes.reserve(m_dirtyAttributes.size() + geometry->attributes().size());
const auto attributeIds = geometry->attributes();
- for (QNodeId attributeId : attributeIds) {
+ for (Qt3DCore::QNodeId attributeId : attributeIds) {
// TO DO: Improvement we could store handles and use the non locking policy on the attributeManager
Attribute *attribute = m_nodesManager->attributeManager()->lookupResource(attributeId);
@@ -2185,7 +2153,7 @@ bool Renderer::updateVAOWithAttributes(Geometry *geometry,
// Index Attribute
bool attributeWasDirty = false;
- if (attribute->attributeType() == QAttribute::IndexAttribute) {
+ if (attribute->attributeType() == Qt3DCore::QAttribute::IndexAttribute) {
if ((attributeWasDirty = attribute->isDirty()) == true || forceUpdate)
m_submissionContext->specifyIndices(buffer);
// Vertex Attribute
@@ -2226,16 +2194,14 @@ bool Renderer::requiresVAOAttributeUpdate(Geometry *geometry,
{
const auto attributeIds = geometry->attributes();
- for (QNodeId attributeId : attributeIds) {
+ for (Qt3DCore::QNodeId attributeId : attributeIds) {
// TO DO: Improvement we could store handles and use the non locking policy on the attributeManager
Attribute *attribute = m_nodesManager->attributeManager()->lookupResource(attributeId);
if (attribute == nullptr)
continue;
- if ((attribute->attributeType() == QAttribute::IndexAttribute && attribute->isDirty()) ||
- (Qt3DCore::contains(command->m_activeAttributes, attribute->nameId()) &&
- attribute->isDirty()))
+ if ((attribute->attributeType() == Qt3DCore::QAttribute::IndexAttribute && attribute->isDirty()) || (Qt3DCore::contains(command->m_activeAttributes, attribute->nameId()) && attribute->isDirty()))
return true;
}
return false;
diff --git a/src/plugins/renderers/opengl/renderer/renderer.pri b/src/plugins/renderers/opengl/renderer/renderer.pri
deleted file mode 100644
index 5d0296523..000000000
--- a/src/plugins/renderers/opengl/renderer/renderer.pri
+++ /dev/null
@@ -1,29 +0,0 @@
-INCLUDEPATH += $$PWD
-
-SOURCES += \
- $$PWD/gllights.cpp \
- $$PWD/openglvertexarrayobject.cpp \
- $$PWD/rendercommand.cpp \
- $$PWD/renderer.cpp \
- $$PWD/renderview.cpp \
- $$PWD/renderviewbuilder.cpp \
- $$PWD/shaderparameterpack.cpp \
- $$PWD/glshader.cpp \
- $$PWD/logging.cpp \
- $$PWD/commandexecuter.cpp
-
-HEADERS += \
- $$PWD/gllights_p.h \
- $$PWD/openglvertexarrayobject_p.h \
- $$PWD/rendercommand_p.h \
- $$PWD/renderer_p.h \
- $$PWD/renderview_p.h \
- $$PWD/renderviewbuilder_p.h \
- $$PWD/shaderparameterpack_p.h \
- $$PWD/shadervariables_p.h \
- $$PWD/glshader_p.h \
- $$PWD/glfence_p.h \
- $$PWD/logging_p.h \
- $$PWD/commandexecuter_p.h \
- $$PWD/frameprofiler_p.h
-
diff --git a/src/plugins/renderers/opengl/renderer/renderer_p.h b/src/plugins/renderers/opengl/renderer/renderer_p.h
index 78dfbe2a5..58b55cc0b 100644
--- a/src/plugins/renderers/opengl/renderer/renderer_p.h
+++ b/src/plugins/renderers/opengl/renderer/renderer_p.h
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_RENDERER_H
#define QT3DRENDER_RENDER_OPENGL_RENDERER_H
@@ -359,6 +323,7 @@ private:
RenderableEntityFilterPtr m_renderableEntityFilterJob;
ComputableEntityFilterPtr m_computableEntityFilterJob;
+ QMutex m_pendingRenderCaptureSendRequestsMutex;
std::vector<Qt3DCore::QNodeId> m_pendingRenderCaptureSendRequests;
void performDraw(const RenderCommand *command);
diff --git a/src/plugins/renderers/opengl/renderer/renderview.cpp b/src/plugins/renderers/opengl/renderer/renderview.cpp
index 055e19b7a..8cd22eaa2 100644
--- a/src/plugins/renderers/opengl/renderer/renderview.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderview.cpp
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "renderview_p.h"
#include <Qt3DRender/qmaterial.h>
@@ -238,8 +202,7 @@ UniformValue RenderView::standardUniformValue(RenderView::StandardUniform standa
case YUpInFBO:
return UniformValue(0.0f);
default:
- Q_UNREACHABLE();
- return UniformValue();
+ Q_UNREACHABLE_RETURN(UniformValue());
}
}
@@ -489,8 +452,7 @@ struct AdjacentSubRangeFinder
{
static bool adjacentSubRange(const RenderCommand &, const RenderCommand &)
{
- Q_UNREACHABLE();
- return false;
+ Q_UNREACHABLE_RETURN(false);
}
};
@@ -677,6 +639,10 @@ struct SubRangeSorter<QSortPolicy::Texture>
return identicalTextureCount < smallestVector.size();
});
+#else
+ Q_UNUSED(view);
+ Q_UNUSED(begin);
+ Q_UNUSED(end);
#endif
}
};
@@ -699,8 +665,7 @@ int findSubRange(const EntityRenderCommandDataView *view,
case QSortPolicy::Uniform:
return end;
default:
- Q_UNREACHABLE();
- return end;
+ Q_UNREACHABLE_RETURN(end);
}
}
@@ -1112,8 +1077,16 @@ void RenderView::updateRenderCommand(const EntityRenderCommandDataSubView &subVi
void RenderView::updateMatrices()
{
if (m_renderCameraNode && m_renderCameraLens && m_renderCameraLens->isEnabled()) {
- const Matrix4x4 cameraWorld = *(m_renderCameraNode->worldTransform());
- setViewMatrix(m_renderCameraLens->viewMatrix(cameraWorld));
+ auto transform = m_renderCameraNode->renderComponent<Transform>();
+ if (m_renderCameraNode->isParentLessTransform() && transform && transform->hasViewMatrix()) {
+ // optimization: if the entity is a QCamera and it doesn't have a parent with a transform component,
+ // then we use the frontend version of the viewMatrix to avoid extra calculations that may introduce
+ // rounding errors
+ setViewMatrix(transform->viewMatrix());
+ } else {
+ const Matrix4x4 cameraWorld = *(m_renderCameraNode->worldTransform());
+ setViewMatrix(m_renderCameraLens->viewMatrix(cameraWorld));
+ }
setViewProjectionMatrix(m_renderCameraLens->projection() * viewMatrix());
//To get the eyePosition of the camera, we need to use the inverse of the
@@ -1210,11 +1183,11 @@ void RenderView::setShaderStorageValue(ShaderParameterPack &uniformPack,
}
void RenderView::setDefaultUniformBlockShaderDataValue(ShaderParameterPack &uniformPack,
- const GLShader *shader,
+ const std::vector<int> &uniformsNamesIds,
ShaderData *shaderData,
const QString &structName) const
{
- UniformBlockValueBuilder builder(shader->uniformsNamesIds(),
+ UniformBlockValueBuilder builder(uniformsNamesIds,
m_manager->shaderDataManager(),
m_manager->textureManager(),
m_viewMatrix);
@@ -1258,7 +1231,7 @@ void RenderView::applyParameter(const Parameter *param,
if (uniformValue.valueType() == UniformValue::NodeId &&
(shaderData = m_manager->shaderDataManager()->lookupResource(*uniformValue.constData<Qt3DCore::QNodeId>())) != nullptr) {
// Try to check if we have a struct or array matching a QShaderData parameter
- setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader, shaderData, StringToInt::lookupString(nameId));
+ setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader->uniformsNamesIds(), shaderData, StringToInt::lookupString(nameId));
}
break;
}
@@ -1382,7 +1355,7 @@ void RenderView::updateLightUniforms(RenderCommand *command, const Entity *entit
break;
const Entity *lightEntity = lightSource.entity;
const Matrix4x4 lightWorldTransform = *(lightEntity->worldTransform());
- const Vector3D worldPos = lightWorldTransform * Vector3D(0.0f, 0.0f, 0.0f);
+ const Vector3D worldPos = lightWorldTransform.map(Vector3D(0.0f, 0.0f, 0.0f));
for (Light *light : lightSource.lights) {
if (!light->isEnabled())
continue;
@@ -1414,8 +1387,8 @@ void RenderView::updateLightUniforms(RenderCommand *command, const Entity *entit
if (worldTransform)
shaderData->updateWorldTransform(*worldTransform);
- setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader, shaderData, GLLights::LIGHT_STRUCT_NAMES[lightIdx]);
- setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader, shaderData, GLLights::LIGHT_STRUCT_UNROLL_NAMES[lightIdx]);
+ setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader->lightUniformsNamesIds(), shaderData, GLLights::LIGHT_STRUCT_NAMES[lightIdx]);
+ setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader->lightUniformsNamesIds(), shaderData, GLLights::LIGHT_STRUCT_UNROLL_NAMES[lightIdx]);
++lightIdx;
}
}
@@ -1448,7 +1421,8 @@ void RenderView::updateLightUniforms(RenderCommand *command, const Entity *entit
if (m_environmentLight && m_environmentLight->isEnabled()) {
ShaderData *shaderData = m_manager->shaderDataManager()->lookupResource(m_environmentLight->shaderData());
if (shaderData) {
- setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader, shaderData, QStringLiteral("envLight"));
+ // EnvLight isn't part of the light uniform name ids
+ setDefaultUniformBlockShaderDataValue(command->m_parameterPack, shader->uniformsNamesIds(), shaderData, QStringLiteral("envLight"));
auto irr =
shaderData->properties()["irradiance"].value.value<Qt3DCore::QNodeId>();
auto spec =
diff --git a/src/plugins/renderers/opengl/renderer/renderview_p.h b/src/plugins/renderers/opengl/renderer/renderview_p.h
index d67a04b8c..ceae71501 100644
--- a/src/plugins/renderers/opengl/renderer/renderview_p.h
+++ b/src/plugins/renderers/opengl/renderer/renderview_p.h
@@ -1,42 +1,6 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_RENDERVIEW_H
#define QT3DRENDER_RENDER_OPENGL_RENDERVIEW_H
@@ -392,7 +356,7 @@ private:
const ShaderStorageBlock &block,
const UniformValue &value) const;
void setDefaultUniformBlockShaderDataValue(ShaderParameterPack &uniformPack,
- const GLShader *shader,
+ const std::vector<int> &uniformsNamesIds,
ShaderData *shaderData,
const QString &structName) const;
void applyParameter(const Parameter *param,
diff --git a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
index d21c205c3..7f7829b40 100644
--- a/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
+++ b/src/plugins/renderers/opengl/renderer/renderviewbuilder.cpp
@@ -1,47 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "renderviewbuilder_p.h"
#include <Qt3DRender/private/qrenderaspect_p.h>
#include <Qt3DRender/private/rendersyncjobs_p.h>
-
-#include <QThread>
+#include <Qt3DCore/private/qaspectjobmanager_p.h>
QT_BEGIN_NAMESPACE
@@ -90,7 +53,7 @@ RenderViewBuilder::RenderViewBuilder(Render::FrameGraphNode *leafNode, int rende
// In some cases having less jobs is better (especially on fast cpus where
// splitting just adds more overhead). Ideally, we should try to set the value
// depending on the platform/CPU/nbr of cores
- m_optimalParallelJobCount = QThread::idealThreadCount();
+ m_optimalParallelJobCount = Qt3DCore::QAspectJobManager::idealThreadCount();
}
RenderViewInitializerJobPtr RenderViewBuilder::renderViewJob() const
diff --git a/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h b/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h
index acf4f9892..39b9509ef 100644
--- a/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h
+++ b/src/plugins/renderers/opengl/renderer/renderviewbuilder_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_RENDERVIEWBUILDER_H
#define QT3DRENDER_RENDER_OPENGL_RENDERVIEWBUILDER_H
diff --git a/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp b/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp
index 6eaaaa84a..683d04d8d 100644
--- a/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp
+++ b/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "shaderparameterpack_p.h"
@@ -98,12 +62,28 @@ void ShaderParameterPack::setImage(const int glslNameId, int uniformArrayIndex,
// Contains Uniform Block Index and QNodeId of the ShaderData (UBO)
void ShaderParameterPack::setUniformBuffer(BlockToUBO blockToUBO)
{
- m_uniformBuffers.push_back(std::move(blockToUBO));
+ const auto uEnd = m_uniformBuffers.end();
+ auto it = std::find_if(m_uniformBuffers.begin(), uEnd, [&] (const BlockToUBO &block) {
+ return blockToUBO.m_blockIndex == block.m_blockIndex;
+ });
+
+ if (it == uEnd)
+ m_uniformBuffers.push_back(std::move(blockToUBO));
+ else
+ *it = std::move(blockToUBO);
}
void ShaderParameterPack::setShaderStorageBuffer(BlockToSSBO blockToSSBO)
{
- m_shaderStorageBuffers.push_back(std::move(blockToSSBO));
+ const auto uEnd = m_shaderStorageBuffers.end();
+ auto it = std::find_if(m_shaderStorageBuffers.begin(), uEnd, [&] (const BlockToSSBO &block) {
+ return blockToSSBO.m_blockIndex == block.m_blockIndex;
+ });
+
+ if (it == uEnd)
+ m_shaderStorageBuffers.push_back(std::move(blockToSSBO));
+ else
+ *it = std::move(blockToSSBO);
}
void ShaderParameterPack::setSubmissionUniformIndex(const int uniformIdx)
diff --git a/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h b/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h
index 0825c9c47..f963aacb0 100644
--- a/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h
+++ b/src/plugins/renderers/opengl/renderer/shaderparameterpack_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_SHADERPARAMETERPACK_P_H
#define QT3DRENDER_RENDER_OPENGL_SHADERPARAMETERPACK_P_H
diff --git a/src/plugins/renderers/opengl/renderer/shadervariables_p.h b/src/plugins/renderers/opengl/renderer/shadervariables_p.h
index 5dc50fccb..6fd0fdff0 100644
--- a/src/plugins/renderers/opengl/renderer/shadervariables_p.h
+++ b/src/plugins/renderers/opengl/renderer/shadervariables_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_SHADERVARIABLES_P_H
#define QT3DRENDER_RENDER_OPENGL_SHADERVARIABLES_P_H
diff --git a/src/plugins/renderers/opengl/textures/gltexture.cpp b/src/plugins/renderers/opengl/textures/gltexture.cpp
index 88d6e1853..7f358b0e3 100644
--- a/src/plugins/renderers/opengl/textures/gltexture.cpp
+++ b/src/plugins/renderers/opengl/textures/gltexture.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <QtCore/qhash.h>
#include "gltexture_p.h"
@@ -45,9 +9,7 @@
#include <private/qopengltexturehelper_p.h>
#include <QDebug>
#include <QOpenGLFunctions>
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtOpenGL/QOpenGLVersionFunctionsFactory>
-#endif
#include <QOpenGLTexture>
#include <QOpenGLPixelTransferOptions>
#include <Qt3DRender/qtexture.h>
@@ -66,8 +28,6 @@
QT_BEGIN_NAMESPACE
-using namespace Qt3DCore;
-
namespace Qt3DRender {
namespace Render {
namespace OpenGL {
@@ -197,7 +157,7 @@ bool GLTexture::loadTextureDataFromGenerator()
void GLTexture::loadTextureDataFromImages()
{
int maxMipLevel = 0;
- for (const Image &img : qAsConst(m_images)) {
+ for (const Image &img : std::as_const(m_images)) {
const QTextureImageDataPtr imgData = img.generator->operator()();
// imgData may be null in the following cases:
// - Texture is created with TextureImages which have yet to be
@@ -692,11 +652,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId()
if (ctxGLVersion.first > 4 || (ctxGLVersion.first == 4 && ctxGLVersion.second >= 5)) {
// Only for GL 4.5+
#ifdef GL_TEXTURE_TARGET
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QOpenGLFunctions_4_5_Core *gl5 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_5_Core>();
-#else
- QOpenGLFunctions_4_5_Core *gl5 = ctx->versionFunctions<QOpenGLFunctions_4_5_Core>();
-#endif
if (gl5 != nullptr)
gl5->glGetTextureParameteriv(m_sharedTextureId, GL_TEXTURE_TARGET, reinterpret_cast<int *>(&m_properties.target));
#endif
@@ -768,11 +724,7 @@ void GLTexture::introspectPropertiesFromSharedTextureId()
#if !QT_CONFIG(opengles2)
// Try to retrieve dimensions (not available on ES 2.0)
if (!ctx->isOpenGLES()) {
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QOpenGLFunctions_3_1 *gl3 = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_3_1>();
-#else
- QOpenGLFunctions_3_1 *gl3 = ctx->versionFunctions<QOpenGLFunctions_3_1>();
-#endif
if (!gl3) {
qWarning() << "Failed to retrieve shared texture dimensions";
return;
diff --git a/src/plugins/renderers/opengl/textures/gltexture_p.h b/src/plugins/renderers/opengl/textures/gltexture_p.h
index 7a6564831..ec0a80ce6 100644
--- a/src/plugins/renderers/opengl/textures/gltexture_p.h
+++ b/src/plugins/renderers/opengl/textures/gltexture_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_GLTEXTURE_H
#define QT3DRENDER_RENDER_OPENGL_GLTEXTURE_H
diff --git a/src/plugins/renderers/opengl/textures/renderbuffer.cpp b/src/plugins/renderers/opengl/textures/renderbuffer.cpp
index a8cd57515..43b13d666 100644
--- a/src/plugins/renderers/opengl/textures/renderbuffer.cpp
+++ b/src/plugins/renderers/opengl/textures/renderbuffer.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "renderbuffer_p.h"
#include <QOpenGLContext>
diff --git a/src/plugins/renderers/opengl/textures/renderbuffer_p.h b/src/plugins/renderers/opengl/textures/renderbuffer_p.h
index e14716320..ad87a06ac 100644
--- a/src/plugins/renderers/opengl/textures/renderbuffer_p.h
+++ b/src/plugins/renderers/opengl/textures/renderbuffer_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QT3DRENDER_RENDER_OPENGL_RENDERBUFFER_P_H
#define QT3DRENDER_RENDER_OPENGL_RENDERBUFFER_P_H
diff --git a/src/plugins/renderers/opengl/textures/textures.pri b/src/plugins/renderers/opengl/textures/textures.pri
deleted file mode 100644
index e17abfbb3..000000000
--- a/src/plugins/renderers/opengl/textures/textures.pri
+++ /dev/null
@@ -1,9 +0,0 @@
-INCLUDEPATH += $$PWD
-
-SOURCES += \
- $$PWD/gltexture.cpp \
- $$PWD/renderbuffer.cpp
-
-HEADERS += \
- $$PWD/gltexture_p.h \
- $$PWD/renderbuffer_p.h