diff options
Diffstat (limited to 'src/gui/opengl')
27 files changed, 463 insertions, 1379 deletions
diff --git a/src/gui/opengl/opengl.pri b/src/gui/opengl/opengl.pri deleted file mode 100644 index 61f333ec69..0000000000 --- a/src/gui/opengl/opengl.pri +++ /dev/null @@ -1,19 +0,0 @@ -# Qt gui library, opengl module - -qtConfig(opengl): CONFIG += opengl -qtConfig(opengles2): CONFIG += opengles2 - -qtConfig(opengl) { - HEADERS += opengl/qopengl.h \ - opengl/qopengl_p.h \ - opengl/qopenglfunctions.h \ - opengl/qopenglextensions_p.h \ - opengl/qopenglextrafunctions.h \ - opengl/qopenglprogrambinarycache_p.h - - SOURCES += opengl/qopengl.cpp \ - opengl/qopenglfunctions.cpp \ - opengl/qopenglprogrambinarycache.cpp -} - -include(platform/platform.pri) diff --git a/src/gui/opengl/platform/egl/egl.pri b/src/gui/opengl/platform/egl/egl.pri deleted file mode 100644 index 78d3cc2e54..0000000000 --- a/src/gui/opengl/platform/egl/egl.pri +++ /dev/null @@ -1,32 +0,0 @@ -HEADERS += \ - opengl/platform/egl/qeglconvenience_p.h \ - opengl/platform/egl/qeglstreamconvenience_p.h \ - opengl/platform/egl/qt_egl_p.h - -SOURCES += \ - opengl/platform/egl/qeglconvenience.cpp \ - opengl/platform/egl/qeglstreamconvenience.cpp - -qtConfig(opengl) { - HEADERS += \ - opengl/platform/egl/qeglplatformcontext_p.h \ - opengl/platform/egl/qeglpbuffer_p.h - - SOURCES += \ - opengl/platform/egl/qeglplatformcontext.cpp \ - opengl/platform/egl/qeglpbuffer.cpp -} - -qtConfig(egl_x11) { - HEADERS += \ - opengl/platform/egl/qxlibeglintegration_p.h - SOURCES += \ - opengl/platform/egl/qxlibeglintegration.cpp - QMAKE_USE_PRIVATE += xlib -} else { - # Avoid X11 header collision, use generic EGL native types - DEFINES += QT_EGL_NO_X11 -} -CONFIG += egl - -qtConfig(dlopen): QMAKE_USE_PRIVATE += libdl diff --git a/src/gui/opengl/platform/egl/qeglconvenience.cpp b/src/gui/opengl/platform/egl/qeglconvenience.cpp index 6076498b3e..4af50d72f2 100644 --- a/src/gui/opengl/platform/egl/qeglconvenience.cpp +++ b/src/gui/opengl/platform/egl/qeglconvenience.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 <QtCore/qbytearray.h> @@ -124,13 +88,12 @@ QList<EGLint> q_createConfigAttributesFromFormat(const QSurfaceFormat &format) bool q_reduceConfigAttributes(QList<EGLint> *configAttributes) { - int i = -1; // Reduce the complexity of a configuration request to ask for less // because the previous request did not result in success. Returns // true if the complexity was reduced, or false if no further // reductions in complexity are possible. - i = configAttributes->indexOf(EGL_SWAP_BEHAVIOR); + qsizetype i = configAttributes->indexOf(EGL_SWAP_BEHAVIOR); if (i >= 0) { configAttributes->remove(i,2); } @@ -252,14 +215,17 @@ EGLConfig QEglConfigChooser::chooseConfig() configureAttributes.append(EGL_OPENVG_BIT); break; #ifdef EGL_VERSION_1_4 - case QSurfaceFormat::DefaultRenderableType: + case QSurfaceFormat::DefaultRenderableType: { #ifndef QT_NO_OPENGL - if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) + // NVIDIA EGL only provides desktop GL for development purposes, and recommends against using it. + const char *vendor = eglQueryString(display(), EGL_VENDOR); + if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL && (!vendor || !strstr(vendor, "NVIDIA"))) configureAttributes.append(EGL_OPENGL_BIT); else #endif // QT_NO_OPENGL needsES2Plus = true; break; + } case QSurfaceFormat::OpenGL: configureAttributes.append(EGL_OPENGL_BIT); break; @@ -291,7 +257,7 @@ EGLConfig QEglConfigChooser::chooseConfig() // Fetch all of the matching configurations and find the // first that matches the pixel format we wanted. - int i = configureAttributes.indexOf(EGL_RED_SIZE); + qsizetype i = configureAttributes.indexOf(EGL_RED_SIZE); m_confAttrRed = configureAttributes.at(i+1); i = configureAttributes.indexOf(EGL_GREEN_SIZE); m_confAttrGreen = configureAttributes.at(i+1); @@ -301,7 +267,8 @@ EGLConfig QEglConfigChooser::chooseConfig() m_confAttrAlpha = i == -1 ? 0 : configureAttributes.at(i+1); QList<EGLConfig> configs(matching); - eglChooseConfig(display(), configureAttributes.constData(), configs.data(), configs.size(), &matching); + eglChooseConfig(display(), configureAttributes.constData(), configs.data(), + EGLint(configs.size()), &matching); if (!cfg && matching > 0) cfg = configs.first(); @@ -389,6 +356,7 @@ QSurfaceFormat q_glFormatFromConfig(EGLDisplay display, const EGLConfig config, else if (referenceFormat.renderableType() == QSurfaceFormat::DefaultRenderableType #ifndef QT_NO_OPENGL && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL + && !strstr(eglQueryString(display, EGL_VENDOR), "NVIDIA") #endif && (renderableType & EGL_OPENGL_BIT)) format.setRenderableType(QSurfaceFormat::OpenGL); diff --git a/src/gui/opengl/platform/egl/qeglconvenience_p.h b/src/gui/opengl/platform/egl/qeglconvenience_p.h index 7675d1316a..d4a250c90f 100644 --- a/src/gui/opengl/platform/egl/qeglconvenience_p.h +++ b/src/gui/opengl/platform/egl/qeglconvenience_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QEGLCONVENIENCE_H #define QEGLCONVENIENCE_H diff --git a/src/gui/opengl/platform/egl/qeglpbuffer.cpp b/src/gui/opengl/platform/egl/qeglpbuffer.cpp index 55e199a6ad..6a79d88f8c 100644 --- a/src/gui/opengl/platform/egl/qeglpbuffer.cpp +++ b/src/gui/opengl/platform/egl/qeglpbuffer.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 <QtGui/qoffscreensurface.h> #include "qeglpbuffer_p.h" @@ -65,15 +29,6 @@ QEGLPbuffer::QEGLPbuffer(EGLDisplay display, const QSurfaceFormat &format, QOffs m_hasSurfaceless = !flags.testFlag(QEGLPlatformContext::NoSurfaceless) && q_hasEglExtension(display, "EGL_KHR_surfaceless_context"); - // Disable surfaceless contexts on Mesa for now. As of 10.6.0 and Intel at least, some - // operations (glReadPixels) are unable to work without a surface since they at some - // point temporarily unbind the current FBO and then later blow up in some seemingly - // safe operations, like setting the viewport, that apparently need access to the - // read/draw surface in the Intel backend. - const char *vendor = eglQueryString(display, EGL_VENDOR); // hard to check for GL_ strings here, so blacklist all Mesa - if (vendor && strstr(vendor, "Mesa")) - m_hasSurfaceless = false; - if (m_hasSurfaceless) return; diff --git a/src/gui/opengl/platform/egl/qeglpbuffer_p.h b/src/gui/opengl/platform/egl/qeglpbuffer_p.h index 370c430f38..e6b6db1f38 100644 --- a/src/gui/opengl/platform/egl/qeglpbuffer_p.h +++ b/src/gui/opengl/platform/egl/qeglpbuffer_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QEGLPBUFFER_H #define QEGLPBUFFER_H diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp index 561079b48f..0a6e83e875 100644 --- a/src/gui/opengl/platform/egl/qeglplatformcontext.cpp +++ b/src/gui/opengl/platform/egl/qeglplatformcontext.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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) 2021 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 "qeglplatformcontext_p.h" #include "qeglconvenience_p.h" @@ -44,7 +8,7 @@ #include <QtGui/qopenglcontext.h> #include <QtCore/qdebug.h> -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID #include <QtCore/private/qjnihelpers_p.h> #endif #ifndef Q_OS_WIN @@ -155,6 +119,17 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform } } +#ifdef EGL_EXT_protected_content + if (format.testOption(QSurfaceFormat::ProtectedContent)) { + if (q_hasEglExtension(m_eglDisplay, "EGL_EXT_protected_content")) { + contextAttrs.append(EGL_PROTECTED_CONTENT_EXT); + contextAttrs.append(EGL_TRUE); + } else { + m_format.setOption(QSurfaceFormat::ProtectedContent, false); + } + } +#endif + // Special Options for OpenVG surfaces if (m_format.renderableType() == QSurfaceFormat::OpenVG) { contextAttrs.append(EGL_ALPHA_MASK_SIZE); @@ -194,6 +169,21 @@ QEGLPlatformContext::QEGLPlatformContext(const QSurfaceFormat &format, QPlatform if (printConfig) { qDebug() << "Created context for format" << format << "with config:"; q_printEglConfig(m_eglDisplay, m_eglConfig); + + static const bool printAllConfigs = qEnvironmentVariableIntValue("QT_QPA_EGLFS_DEBUG") > 1; + if (printAllConfigs) { + EGLint numConfigs = 0; + eglGetConfigs(m_eglDisplay, nullptr, 0, &numConfigs); + QVector<EGLConfig> configs; + configs.resize(numConfigs); + eglGetConfigs(m_eglDisplay, configs.data(), numConfigs, &numConfigs); + qDebug("\nAll EGLConfigs: count=%d", numConfigs); + for (EGLint i = 0; i < numConfigs; ++i) { + qDebug("EGLConfig #%d", i); + q_printEglConfig(m_eglDisplay, configs[i]); + } + qDebug("\n"); + } } // Cannot just call updateFormatFromGL() since it relies on virtuals. Defer it to initialize(). diff --git a/src/gui/opengl/platform/egl/qeglplatformcontext_p.h b/src/gui/opengl/platform/egl/qeglplatformcontext_p.h index 899f4b5c9f..b1e9c4b4c2 100644 --- a/src/gui/opengl/platform/egl/qeglplatformcontext_p.h +++ b/src/gui/opengl/platform/egl/qeglplatformcontext_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QEGLPLATFORMCONTEXT_H #define QEGLPLATFORMCONTEXT_H @@ -61,7 +25,7 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QEGLPlatformContext : public QPlatformOpenGLContext, - public QPlatformInterface::QEGLContext + public QNativeInterface::QEGLContext { public: enum Flag { @@ -105,9 +69,13 @@ public: QSurfaceFormat format() const override; bool isSharing() const override { return m_shareContext != EGL_NO_CONTEXT; } - bool isValid() const override { return m_eglContext != EGL_NO_CONTEXT; } + bool isValid() const override { return m_eglContext != EGL_NO_CONTEXT && !m_markedInvalid; } EGLContext nativeContext() const override { return eglContext(); } + EGLConfig config() const override { return eglConfig(); } + EGLDisplay display() const override { return eglDisplay(); } + + virtual void invalidateContext() override { m_markedInvalid = true; } EGLContext eglContext() const; EGLDisplay eglDisplay() const; @@ -136,6 +104,8 @@ private: Flags m_flags; bool m_ownsContext = false; QList<EGLint> m_contextAttrs; + + bool m_markedInvalid = false; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QEGLPlatformContext::Flags) diff --git a/src/gui/opengl/platform/egl/qeglstreamconvenience.cpp b/src/gui/opengl/platform/egl/qeglstreamconvenience.cpp index 228cdbb06b..869e763bb8 100644 --- a/src/gui/opengl/platform/egl/qeglstreamconvenience.cpp +++ b/src/gui/opengl/platform/egl/qeglstreamconvenience.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 "qeglstreamconvenience_p.h" #include <string.h> diff --git a/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h b/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h index 22e124b279..edf73fe981 100644 --- a/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h +++ b/src/gui/opengl/platform/egl/qeglstreamconvenience_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QEGLSTREAMCONVENIENCE_H #define QEGLSTREAMCONVENIENCE_H @@ -149,6 +113,10 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay #define EGL_PLATFORM_X11_KHR 0x31D5 #endif +#ifndef EGL_PLATFORM_XCB_KHR +#define EGL_PLATFORM_XCB_KHR 0x31DC +#endif + #ifndef EGL_NV_stream_attrib typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMATTRIBNVPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSTREAMATTRIBNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLAttrib value); diff --git a/src/gui/opengl/platform/egl/qt_egl_p.h b/src/gui/opengl/platform/egl/qt_egl_p.h index c33cc8aa21..1f538e22af 100644 --- a/src/gui/opengl/platform/egl/qt_egl_p.h +++ b/src/gui/opengl/platform/egl/qt_egl_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QT_EGL_P_H #define QT_EGL_P_H @@ -54,6 +18,7 @@ // q(data/text)stream.h must be included before any header file that defines Status #include <QtCore/qdatastream.h> #include <QtCore/qtextstream.h> +#include <QtCore/private/qglobal_p.h> #ifdef QT_EGL_NO_X11 # ifndef EGL_NO_X11 @@ -65,7 +30,11 @@ # if !defined(Q_OS_INTEGRITY) # define WIN_INTERFACE_CUSTOM // NV # endif // Q_OS_INTEGRITY -#endif // QT_EGL_NO_X11 +#else // QT_EGL_NO_X11 +// If one has an eglplatform.h with https://github.com/KhronosGroup/EGL-Registry/pull/130 +// that needs USE_X11 to be defined. +# define USE_X11 +#endif #ifdef QT_EGL_WAYLAND # define WAYLAND // NV diff --git a/src/gui/opengl/platform/egl/qxlibeglintegration.cpp b/src/gui/opengl/platform/egl/qxlibeglintegration.cpp deleted file mode 100644 index 59f7024c06..0000000000 --- a/src/gui/opengl/platform/egl/qxlibeglintegration.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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$ -** -****************************************************************************/ - -#include <QtCore/qloggingcategory.h> -#include "qxlibeglintegration_p.h" - -QT_BEGIN_NAMESPACE - -Q_LOGGING_CATEGORY(lcXlibEglDebug, "qt.egl.xlib.debug") - -VisualID QXlibEglIntegration::getCompatibleVisualId(Display *display, EGLDisplay eglDisplay, EGLConfig config) -{ - VisualID visualId = 0; - EGLint eglValue = 0; - - EGLint configRedSize = 0; - eglGetConfigAttrib(eglDisplay, config, EGL_RED_SIZE, &configRedSize); - - EGLint configGreenSize = 0; - eglGetConfigAttrib(eglDisplay, config, EGL_GREEN_SIZE, &configGreenSize); - - EGLint configBlueSize = 0; - eglGetConfigAttrib(eglDisplay, config, EGL_BLUE_SIZE, &configBlueSize); - - EGLint configAlphaSize = 0; - eglGetConfigAttrib(eglDisplay, config, EGL_ALPHA_SIZE, &configAlphaSize); - - eglGetConfigAttrib(eglDisplay, config, EGL_CONFIG_ID, &eglValue); - int configId = eglValue; - - // See if EGL provided a valid VisualID: - eglGetConfigAttrib(eglDisplay, config, EGL_NATIVE_VISUAL_ID, &eglValue); - visualId = (VisualID)eglValue; - if (visualId) { - // EGL has suggested a visual id, so get the rest of the visual info for that id: - XVisualInfo visualInfoTemplate; - memset(&visualInfoTemplate, 0, sizeof(XVisualInfo)); - visualInfoTemplate.visualid = visualId; - - XVisualInfo *chosenVisualInfo; - int matchingCount = 0; - chosenVisualInfo = XGetVisualInfo(display, VisualIDMask, &visualInfoTemplate, &matchingCount); - if (chosenVisualInfo) { - // Skip size checks if implementation supports non-matching visual - // and config (QTBUG-9444). - if (q_hasEglExtension(eglDisplay,"EGL_NV_post_convert_rounding")) { - XFree(chosenVisualInfo); - return visualId; - } - // Skip also for i.MX6 where 565 visuals are suggested for the default 444 configs and it works just fine. - const char *vendor = eglQueryString(eglDisplay, EGL_VENDOR); - if (vendor && strstr(vendor, "Vivante")) { - XFree(chosenVisualInfo); - return visualId; - } - - int visualRedSize = qPopulationCount(chosenVisualInfo->red_mask); - int visualGreenSize = qPopulationCount(chosenVisualInfo->green_mask); - int visualBlueSize = qPopulationCount(chosenVisualInfo->blue_mask); - int visualAlphaSize = chosenVisualInfo->depth - visualRedSize - visualBlueSize - visualGreenSize; - - const bool visualMatchesConfig = visualRedSize >= configRedSize - && visualGreenSize >= configGreenSize - && visualBlueSize >= configBlueSize - && visualAlphaSize >= configAlphaSize; - - // In some cases EGL tends to suggest a 24-bit visual for 8888 - // configs. In such a case we have to fall back to XGetVisualInfo. - if (!visualMatchesConfig) { - visualId = 0; - qCDebug(lcXlibEglDebug, - "EGL suggested using X Visual ID %d (%d %d %d %d depth %d) for EGL config %d" - "(%d %d %d %d), but this is incompatible", - (int)visualId, visualRedSize, visualGreenSize, visualBlueSize, visualAlphaSize, chosenVisualInfo->depth, - configId, configRedSize, configGreenSize, configBlueSize, configAlphaSize); - } - } else { - qCDebug(lcXlibEglDebug, "EGL suggested using X Visual ID %d for EGL config %d, but that isn't a valid ID", - (int)visualId, configId); - visualId = 0; - } - XFree(chosenVisualInfo); - } - else - qCDebug(lcXlibEglDebug, "EGL did not suggest a VisualID (EGL_NATIVE_VISUAL_ID was zero) for EGLConfig %d", configId); - - if (visualId) { - qCDebug(lcXlibEglDebug, configAlphaSize > 0 - ? "Using ARGB Visual ID %d provided by EGL for config %d" - : "Using Opaque Visual ID %d provided by EGL for config %d", (int)visualId, configId); - return visualId; - } - - // Finally, try to use XGetVisualInfo and only use the bit depths to match on: - if (!visualId) { - XVisualInfo visualInfoTemplate; - memset(&visualInfoTemplate, 0, sizeof(XVisualInfo)); - XVisualInfo *matchingVisuals; - int matchingCount = 0; - - visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize + configAlphaSize; - matchingVisuals = XGetVisualInfo(display, - VisualDepthMask, - &visualInfoTemplate, - &matchingCount); - if (!matchingVisuals) { - // Try again without taking the alpha channel into account: - visualInfoTemplate.depth = configRedSize + configGreenSize + configBlueSize; - matchingVisuals = XGetVisualInfo(display, - VisualDepthMask, - &visualInfoTemplate, - &matchingCount); - } - - if (matchingVisuals) { - visualId = matchingVisuals[0].visualid; - XFree(matchingVisuals); - } - } - - if (visualId) { - qCDebug(lcXlibEglDebug, "Using Visual ID %d provided by XGetVisualInfo for EGL config %d", (int)visualId, configId); - return visualId; - } - - qWarning("Unable to find an X11 visual which matches EGL config %d", configId); - return (VisualID)0; -} - -QT_END_NAMESPACE diff --git a/src/gui/opengl/platform/egl/qxlibeglintegration_p.h b/src/gui/opengl/platform/egl/qxlibeglintegration_p.h deleted file mode 100644 index 2c4e0b5080..0000000000 --- a/src/gui/opengl/platform/egl/qxlibeglintegration_p.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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$ -** -****************************************************************************/ - -#ifndef QXLIBEGLINTEGRATION_H -#define QXLIBEGLINTEGRATION_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtGui/private/qeglconvenience_p.h> -#include <X11/X.h> -#include <X11/Xlib.h> -#include <X11/Xutil.h> - -QT_BEGIN_NAMESPACE - -class Q_GUI_EXPORT QXlibEglIntegration -{ -public: - static VisualID getCompatibleVisualId(Display *display, EGLDisplay eglDisplay, EGLConfig config); -}; - -QT_END_NAMESPACE - -#endif // QXLIBEGLINTEGRATION_H diff --git a/src/gui/opengl/platform/platform.pri b/src/gui/opengl/platform/platform.pri deleted file mode 100644 index 193bd9e59b..0000000000 --- a/src/gui/opengl/platform/platform.pri +++ /dev/null @@ -1,4 +0,0 @@ -qtConfig(xlib):qtConfig(opengl):!qtConfig(opengles2): \ - include(unix/unix.pri) -qtConfig(egl): \ - include(egl/egl.pri) diff --git a/src/gui/opengl/platform/unix/qglxconvenience.cpp b/src/gui/opengl/platform/unix/qglxconvenience.cpp index fd6f1639a3..ce70818042 100644 --- a/src/gui/opengl/platform/unix/qglxconvenience.cpp +++ b/src/gui/opengl/platform/unix/qglxconvenience.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtOpenGL 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 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 // We have to include this before the X11 headers dragged in by // qglxconvenience_p.h. @@ -160,7 +124,7 @@ struct QXcbSoftwareOpenGLEnforcer { } if (forceSoftwareOpenGL) - qputenv("LIBGL_ALWAYS_SOFTWARE", QByteArrayLiteral("1")); + qputenv("LIBGL_ALWAYS_SOFTWARE", "1"); } ~QXcbSoftwareOpenGLEnforcer() { diff --git a/src/gui/opengl/platform/unix/qglxconvenience_p.h b/src/gui/opengl/platform/unix/qglxconvenience_p.h index ecd8737f87..c755356c50 100644 --- a/src/gui/opengl/platform/unix/qglxconvenience_p.h +++ b/src/gui/opengl/platform/unix/qglxconvenience_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtOpenGL 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 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 QGLXCONVENIENCE_H #define QGLXCONVENIENCE_H @@ -53,6 +17,7 @@ #include <QtCore/qlist.h> #include <QtGui/qsurfaceformat.h> +#include <QtCore/private/qglobal_p.h> #include <X11/Xlib.h> #include <GL/glx.h> diff --git a/src/gui/opengl/platform/unix/unix.pri b/src/gui/opengl/platform/unix/unix.pri deleted file mode 100644 index 6365a18756..0000000000 --- a/src/gui/opengl/platform/unix/unix.pri +++ /dev/null @@ -1,7 +0,0 @@ -HEADERS += \ - opengl/platform/unix/qglxconvenience_p.h - -SOURCES += \ - opengl/platform/unix/qglxconvenience.cpp - -QMAKE_USE_PRIVATE += xlib diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index 3066b83282..587975085a 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 "qopengl.h" #include "qopengl_p.h" @@ -56,6 +20,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + #if defined(QT_OPENGL_3) typedef const GLubyte * (QOPENGLF_APIENTRYP qt_glGetStringi)(GLenum, GLuint); #endif @@ -210,10 +176,10 @@ VersionTerm VersionTerm::fromJson(const QJsonValue &v) if (!v.isObject()) return result; const QJsonObject o = v.toObject(); - result.number = QVersionNumber::fromString(o.value(QLatin1String("value")).toString()); - const QString opS = o.value(QLatin1String("op")).toString(); + result.number = QVersionNumber::fromString(o.value("value"_L1).toString()); + const QString opS = o.value("op"_L1).toString(); for (size_t i = 0; i < sizeof(operators) / sizeof(operators[0]); ++i) { - if (opS == QLatin1String(operators[i])) { + if (opS == QLatin1StringView(operators[i])) { result.op = static_cast<Operator>(i); break; } @@ -229,29 +195,13 @@ struct OsTypeTerm static QString hostOs(); static QVersionNumber hostKernelVersion() { return QVersionNumber::fromString(QSysInfo::kernelVersion()); } static QString hostOsRelease() { - QString ver; #ifdef Q_OS_WIN - const auto osver = QOperatingSystemVersion::current(); -#define Q_WINVER(major, minor) (major << 8 | minor) - switch (Q_WINVER(osver.majorVersion(), osver.minorVersion())) { - case Q_WINVER(6, 1): - ver = QStringLiteral("7"); - break; - case Q_WINVER(6, 2): - ver = QStringLiteral("8"); - break; - case Q_WINVER(6, 3): - ver = QStringLiteral("8.1"); - break; - case Q_WINVER(10, 0): - ver = QStringLiteral("10"); - break; - default: - break; - } -#undef Q_WINVER + if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows11) + return u"11"_s; + return u"10"_s; +#else + return {}; #endif - return ver; } bool isNull() const { return type.isEmpty(); } @@ -282,9 +232,9 @@ OsTypeTerm OsTypeTerm::fromJson(const QJsonValue &v) if (!v.isObject()) return result; const QJsonObject o = v.toObject(); - result.type = o.value(QLatin1String("type")).toString(); - result.versionTerm = VersionTerm::fromJson(o.value(QLatin1String("version"))); - result.release = o.value(QLatin1String("release")).toArray(); + result.type = o.value("type"_L1).toString(); + result.versionTerm = VersionTerm::fromJson(o.value("version"_L1)); + result.release = o.value("release"_L1).toArray(); return result; } @@ -308,8 +258,8 @@ QString OsTypeTerm::hostOs() static QString msgSyntaxWarning(const QJsonObject &object, const QString &what) { QString result; - QTextStream(&result) << "Id " << object.value(QLatin1String("id")).toInt() - << " (\"" << object.value(QLatin1String("description")).toString() + QTextStream(&result) << "Id " << object.value("id"_L1).toInt() + << " (\"" << object.value("description"_L1).toString() << "\"): " << what; return result; } @@ -323,11 +273,11 @@ static bool matches(const QJsonObject &object, const QString &osRelease, const QOpenGLConfig::Gpu &gpu) { - const OsTypeTerm os = OsTypeTerm::fromJson(object.value(QLatin1String("os"))); + const OsTypeTerm os = OsTypeTerm::fromJson(object.value("os"_L1)); if (!os.isNull() && !os.matches(osName, kernelVersion, osRelease)) return false; - const QJsonValue exceptionsV = object.value(QLatin1String("exceptions")); + const QJsonValue exceptionsV = object.value("exceptions"_L1); if (exceptionsV.isArray()) { const QJsonArray exceptionsA = exceptionsV.toArray(); for (JsonArrayConstIt it = exceptionsA.constBegin(), cend = exceptionsA.constEnd(); it != cend; ++it) { @@ -336,20 +286,20 @@ static bool matches(const QJsonObject &object, } } - const QJsonValue vendorV = object.value(QLatin1String("vendor_id")); + const QJsonValue vendorV = object.value("vendor_id"_L1); if (vendorV.isString()) { if (gpu.vendorId != vendorV.toString().toUInt(nullptr, /* base */ 0)) return false; } else { - if (object.contains(QLatin1String("gl_vendor"))) { - const QByteArray glVendorV = object.value(QLatin1String("gl_vendor")).toString().toUtf8(); + if (object.contains("gl_vendor"_L1)) { + const QByteArray glVendorV = object.value("gl_vendor"_L1).toString().toUtf8(); if (!gpu.glVendor.contains(glVendorV)) return false; } } if (gpu.deviceId) { - const QJsonValue deviceIdV = object.value(QLatin1String("device_id")); + const QJsonValue deviceIdV = object.value("device_id"_L1); switch (deviceIdV.type()) { case QJsonValue::Array: if (!contains(deviceIdV.toArray(), gpu.deviceId)) @@ -360,12 +310,11 @@ static bool matches(const QJsonObject &object, break; default: qWarning().noquote() - << msgSyntaxWarning(object, - QLatin1String("Device ID must be of type array.")); + << msgSyntaxWarning(object, "Device ID must be of type array."_L1); } } if (!gpu.driverVersion.isNull()) { - const QJsonValue driverVersionV = object.value(QLatin1String("driver_version")); + const QJsonValue driverVersionV = object.value("driver_version"_L1); switch (driverVersionV.type()) { case QJsonValue::Object: if (!VersionTerm::fromJson(driverVersionV).matches(gpu.driverVersion)) @@ -376,13 +325,12 @@ static bool matches(const QJsonObject &object, break; default: qWarning().noquote() - << msgSyntaxWarning(object, - QLatin1String("Driver version must be of type object.")); + << msgSyntaxWarning(object, "Driver version must be of type object."_L1); } } if (!gpu.driverDescription.isEmpty()) { - const QJsonValue driverDescriptionV = object.value(QLatin1String("driver_description")); + const QJsonValue driverDescriptionV = object.value("driver_description"_L1); if (driverDescriptionV.isString()) { if (!gpu.driverDescription.contains(driverDescriptionV.toString().toUtf8())) return false; @@ -402,9 +350,9 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu, { result->clear(); errorMessage->clear(); - const QJsonValue entriesV = doc.object().value(QLatin1String("entries")); + const QJsonValue entriesV = doc.object().value("entries"_L1); if (!entriesV.isArray()) { - *errorMessage = QLatin1String("No entries read."); + *errorMessage = "No entries read."_L1; return false; } @@ -413,7 +361,7 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu, if (eit->isObject()) { const QJsonObject object = eit->toObject(); if (matches(object, osName, kernelVersion, osRelease, gpu)) { - const QJsonValue featuresListV = object.value(QLatin1String("features")); + const QJsonValue featuresListV = object.value("features"_L1); if (featuresListV.isArray()) { const QJsonArray featuresListA = featuresListV.toArray(); for (JsonArrayConstIt fit = featuresListA.constBegin(), fcend = featuresListA.constEnd(); fit != fcend; ++fit) @@ -437,7 +385,8 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu, QJsonParseError error; const QJsonDocument document = QJsonDocument::fromJson(jsonAsciiData, &error); if (document.isNull()) { - const int lineNumber = 1 + jsonAsciiData.left(error.offset).count('\n'); + const qsizetype lineNumber = + QByteArrayView(jsonAsciiData).left(error.offset).count('\n') + 1; QTextStream str(errorMessage); str << "Failed to parse data: \"" << error.errorString() << "\" at line " << lineNumber << " (offset: " @@ -465,9 +414,9 @@ static bool readGpuFeatures(const QOpenGLConfig::Gpu &gpu, } const bool success = readGpuFeatures(gpu, osName, kernelVersion, osRelease, file.readAll(), result, errorMessage); if (!success) { - errorMessage->prepend(QLatin1String("Error reading \"") + errorMessage->prepend("Error reading \""_L1 + QDir::toNativeSeparators(fileName) - + QLatin1String("\": ")); + + "\": "_L1); } return success; } diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index 5c0885f4ec..e9a11080ce 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QOPENGL_H #define QOPENGL_H @@ -44,9 +8,19 @@ #ifndef QT_NO_OPENGL -// Windows always needs this to ensure that APIENTRY gets defined +// On Windows we need to ensure that APIENTRY and WINGDIAPI are defined before +// we can include gl.h. But we do not want to include <windows.h> in this public +// Qt header, as it pollutes the global namespace with macros. #if defined(Q_OS_WIN) -# include <QtCore/qt_windows.h> +# ifndef APIENTRY +# define APIENTRY __stdcall +# define Q_UNDEF_APIENTRY +# endif // APIENTRY +# ifndef WINGDIAPI +# define WINGDIAPI __declspec(dllimport) +# define Q_UNDEF_WINGDIAPI +# endif // WINGDIAPI +# define QT_APIENTRY __stdcall #endif // Note: Apple is a "controlled platform" for OpenGL ABI so we @@ -157,20 +131,18 @@ typedef char GLchar; # endif #endif -QT_BEGIN_NAMESPACE - // When all else fails we provide sensible fallbacks - this is needed to // allow compilation on OS X 10.6 #if !QT_CONFIG(opengles2) // OS X 10.6 doesn't define these which are needed below -// OS X 10.7 and later defien them in gl3.h -#ifndef APIENTRY -#define APIENTRY +// OS X 10.7 and later define them in gl3.h +#ifndef QT_APIENTRY +#define QT_APIENTRY #endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * +#ifndef QT_APIENTRYP +#define QT_APIENTRYP QT_APIENTRY * #endif #ifndef GLAPI #define GLAPI extern @@ -269,15 +241,15 @@ struct _cl_event; #endif #ifndef GL_ARB_debug_output -typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); +typedef void (QT_APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); #endif #ifndef GL_AMD_debug_output -typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +typedef void (QT_APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); #endif #ifndef GL_KHR_debug -typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); +typedef void (QT_APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); #endif #ifndef GL_NV_vdpau_interop @@ -287,14 +259,15 @@ typedef GLintptr GLvdpauSurfaceNV; // End of block copied from glext.h #endif +QT_BEGIN_NAMESPACE // Types that aren't defined in all system's gl.h files. typedef ptrdiff_t qopengl_GLintptr; typedef ptrdiff_t qopengl_GLsizeiptr; -#if defined(APIENTRY) && !defined(QOPENGLF_APIENTRY) -# define QOPENGLF_APIENTRY APIENTRY +#if defined(QT_APIENTRY) && !defined(QOPENGLF_APIENTRY) +# define QOPENGLF_APIENTRY QT_APIENTRY #endif # ifndef QOPENGLF_APIENTRYP @@ -308,6 +281,15 @@ typedef ptrdiff_t qopengl_GLsizeiptr; QT_END_NAMESPACE +#ifdef Q_UNDEF_WINGDIAPI +# undef WINGDIAPI +# undef Q_UNDEF_WINGDIAPI +#endif +#ifdef Q_UNDEF_APIENTRY +# undef APIENTRY +# undef Q_UNDEF_APIENTRY +#endif + #endif // QT_NO_OPENGL #endif // QOPENGL_H diff --git a/src/gui/opengl/qopengl_p.h b/src/gui/opengl/qopengl_p.h index 07fd159ba8..a3b2be7b49 100644 --- a/src/gui/opengl/qopengl_p.h +++ b/src/gui/opengl/qopengl_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QOPENGL_P_H #define QOPENGL_P_H diff --git a/src/gui/opengl/qopenglextensions_p.h b/src/gui/opengl/qopenglextensions_p.h index 0d58b5f301..a6c4a68c6c 100644 --- a/src/gui/opengl/qopenglextensions_p.h +++ b/src/gui/opengl/qopenglextensions_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QOPENGL_EXTENSIONS_P_H #define QOPENGL_EXTENSIONS_P_H @@ -93,6 +57,11 @@ public: Sized16Formats = 0x00800000, TextureSwizzle = 0x01000000, StandardDerivatives = 0x02000000, + ASTCTextureCompression = 0x04000000, + ETC2TextureCompression = 0x08000000, + HalfFloatVertex = 0x10000000, + MultiView = 0x20000000, + MultiViewExtended = 0x40000000 }; Q_DECLARE_FLAGS(OpenGLExtensions, OpenGLExtension) @@ -101,9 +70,9 @@ public: GLvoid *glMapBuffer(GLenum target, GLenum access); void glGetBufferSubData(GLenum target, qopengl_GLintptr offset, qopengl_GLsizeiptr size, GLvoid *data); - void glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); void flushShared(); + void discardFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments); QOpenGLExtensionsPrivate *d() const; @@ -148,14 +117,6 @@ inline void QOpenGLExtensions::glGetBufferSubData(GLenum target, qopengl_GLintpt Q_OPENGL_FUNCTIONS_DEBUG } - -inline void QOpenGLExtensions::glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments) -{ - Q_D(QOpenGLExtensions); - Q_ASSERT(QOpenGLExtensions::isInitialized(d)); - d->DiscardFramebuffer(target,numAttachments, attachments); - Q_OPENGL_FUNCTIONS_DEBUG -} QT_END_NAMESPACE #endif // QOPENGL_EXTENSIONS_P_H diff --git a/src/gui/opengl/qopenglextrafunctions.h b/src/gui/opengl/qopenglextrafunctions.h index 4b02b1a60d..e2608e9946 100644 --- a/src/gui/opengl/qopenglextrafunctions.h +++ b/src/gui/opengl/qopenglextrafunctions.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QOPENGLEXTRAFUNCTIONS_H #define QOPENGLEXTRAFUNCTIONS_H diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index d2cb4df022..c9352fbc31 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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) 2021 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 "qopenglfunctions.h" #include "qopenglextrafunctions.h" @@ -57,6 +21,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + #define QT_OPENGL_COUNT_FUNCTIONS(ret, name, args) +1 #define QT_OPENGL_FUNCTION_NAMES(ret, name, args) \ "gl"#name"\0" @@ -364,6 +330,8 @@ static int qt_gl_resolve_extensions() extensions |= QOpenGLExtensions::ETC1TextureCompression; if (extensionMatcher.match("GL_IMG_texture_compression_pvrtc")) extensions |= QOpenGLExtensions::PVRTCTextureCompression; + if (extensionMatcher.match("GL_KHR_texture_compression_astc_ldr")) + extensions |= QOpenGLExtensions::ASTCTextureCompression; if (extensionMatcher.match("GL_ARB_texture_mirrored_repeat")) extensions |= QOpenGLExtensions::MirroredRepeat; if (extensionMatcher.match("GL_EXT_stencil_two_side")) @@ -378,6 +346,12 @@ static int qt_gl_resolve_extensions() extensions |= QOpenGLExtensions::TextureSwizzle; if (extensionMatcher.match("GL_OES_standard_derivatives")) extensions |= QOpenGLExtensions::StandardDerivatives; + if (extensionMatcher.match("GL_ARB_half_float_vertex")) + extensions |= QOpenGLExtensions::HalfFloatVertex; + if (extensionMatcher.match("GL_OVR_multiview")) + extensions |= QOpenGLExtensions::MultiView; + if (extensionMatcher.match("GL_OVR_multiview2")) + extensions |= QOpenGLExtensions::MultiViewExtended; if (ctx->isOpenGLES()) { if (format.majorVersion() >= 2) @@ -391,7 +365,10 @@ static int qt_gl_resolve_extensions() | QOpenGLExtensions::FramebufferBlit | QOpenGLExtensions::FramebufferMultisample | QOpenGLExtensions::Sized8Formats - | QOpenGLExtensions::StandardDerivatives; + | QOpenGLExtensions::DiscardFramebuffer + | QOpenGLExtensions::StandardDerivatives + | QOpenGLExtensions::ETC2TextureCompression + | QOpenGLExtensions::HalfFloatVertex; #ifndef Q_OS_WASM // WebGL 2.0 specification explicitly does not support texture swizzles // https://www.khronos.org/registry/webgl/specs/latest/2.0/#5.19 @@ -413,6 +390,8 @@ static int qt_gl_resolve_extensions() extensions |= QOpenGLExtensions::FramebufferMultisample; if (extensionMatcher.match("GL_OES_rgb8_rgba8")) extensions |= QOpenGLExtensions::Sized8Formats; + if (extensionMatcher.match("GL_OES_compressed_ETC2_RGB8_texture")) + extensions |= QOpenGLExtensions::ETC2TextureCompression; } if (extensionMatcher.match("GL_OES_mapbuffer")) @@ -422,13 +401,13 @@ static int qt_gl_resolve_extensions() // We don't match GL_APPLE_texture_format_BGRA8888 here because it has different semantics. if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888")) extensions |= QOpenGLExtensions::BGRATextureFormat; -#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) +#ifdef Q_OS_ANDROID QString *deviceName = static_cast<QString *>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("AndroidDeviceName")); static bool wrongfullyReportsBgra8888Support = deviceName != 0 - && (deviceName->compare(QLatin1String("samsung SM-T211"), Qt::CaseInsensitive) == 0 - || deviceName->compare(QLatin1String("samsung SM-T210"), Qt::CaseInsensitive) == 0 - || deviceName->compare(QLatin1String("samsung SM-T215"), Qt::CaseInsensitive) == 0); + && (deviceName->compare("samsung SM-T211"_L1, Qt::CaseInsensitive) == 0 + || deviceName->compare("samsung SM-T210"_L1, Qt::CaseInsensitive) == 0 + || deviceName->compare("samsung SM-T215"_L1, Qt::CaseInsensitive) == 0); if (wrongfullyReportsBgra8888Support) extensions &= ~QOpenGLExtensions::BGRATextureFormat; #endif @@ -472,6 +451,9 @@ static int qt_gl_resolve_extensions() if (format.version() >= qMakePair(3, 3)) extensions |= QOpenGLExtensions::TextureSwizzle; + if (format.version() >= qMakePair(4, 3) || extensionMatcher.match("GL_ARB_invalidate_subdata")) + extensions |= QOpenGLExtensions::DiscardFramebuffer; + if (extensionMatcher.match("GL_ARB_map_buffer_range")) extensions |= QOpenGLExtensions::MapBufferRange; @@ -481,6 +463,9 @@ static int qt_gl_resolve_extensions() if (srgbCapableFramebuffers) extensions |= QOpenGLExtensions::SRGBFrameBuffer; } + + if (extensionMatcher.match("GL_ARB_ES3_compatibility")) + extensions |= QOpenGLExtensions::ETC2TextureCompression; } return extensions; @@ -580,7 +565,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBindTexture(\a target, \a texture). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBindTexture.xhtml}{glBindTexture()}. \since 5.3 @@ -591,7 +576,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBlendFunc(\a sfactor, \a dfactor). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendFunc.xhtml}{glBlendFunc()}. \since 5.3 @@ -602,7 +587,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glClear(\a mask). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glClear.xhtml}{glClear()}. \since 5.3 @@ -613,7 +598,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glClearColor(\a red, \a green, \a blue, \a alpha). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glClearColor.xhtml}{glClearColor()}. \since 5.3 @@ -624,7 +609,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glClearStencil(\a s). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glClearStencil.xhtml}{glClearStencil()}. \since 5.3 @@ -635,7 +620,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glColorMask(\a red, \a green, \a blue, \a alpha). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glColorMask.xhtml}{glColorMask()}. \since 5.3 @@ -646,7 +631,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCopyTexImage2D(\a target, \a level, \a internalformat, \a x, \a y, \a width, \a height, \a border). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCopyTexImage2D.xhtml}{glCopyTexImage2D()}. \since 5.3 @@ -657,7 +642,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCopyTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a x, \a y, \a width, \a height). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCopyTexSubImage2D.xhtml}{glCopyTexSubImage2D()}. \since 5.3 @@ -668,7 +653,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCullFace(\a mode). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCullFace.xhtml}{glCullFace()}. \since 5.3 @@ -679,7 +664,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDeleteTextures(\a n, \a textures). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDeleteTextures.xhtml}{glDeleteTextures()}. \since 5.3 @@ -690,7 +675,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDepthFunc(\a func). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDepthFunc.xhtml}{glDepthFunc()}. \since 5.3 @@ -701,7 +686,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDepthMask(\a flag). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDepthMask.xhtml}{glDepthMask()}. \since 5.3 @@ -712,8 +697,8 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDisable(\a cap). - For more information, see the OpenGL ES 2.0 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDisable.xhtml}{glDisable()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEnable.xhtml}{glDisable()}. \since 5.3 */ @@ -723,7 +708,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDrawArrays(\a mode, \a first, \a count). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDrawArrays.xhtml}{glDrawArrays()}. \since 5.3 @@ -734,7 +719,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDrawElements(\a mode, \a count, \a type, \a indices). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDrawElements.xhtml}{glDrawElements()}. \since 5.3 @@ -745,7 +730,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glEnable(\a cap). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEnable.xhtml}{glEnable()}. \since 5.3 @@ -756,7 +741,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glFinish(). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glFinish.xhtml}{glFinish()}. \since 5.3 @@ -767,7 +752,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glFlush(). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glFlush.xhtml}{glFlush()}. \since 5.3 @@ -778,7 +763,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glFrontFace(\a mode). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glFrontFace.xhtml}{glFrontFace()}. \since 5.3 @@ -789,7 +774,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGenTextures(\a n, \a textures). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGenTextures.xhtml}{glGenTextures()}. \since 5.3 @@ -800,7 +785,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetBooleanv(\a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGet.xhtml}{glGetBooleanv()}. \since 5.3 @@ -811,7 +796,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetError(). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetError.xhtml}{glGetError()}. \since 5.3 @@ -822,7 +807,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetFloatv(\a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGet.xhtml}{glGetFloatv()}. \since 5.3 @@ -833,7 +818,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetIntegerv(\a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGet.xhtml}{glGetIntegerv()}. \since 5.3 @@ -844,7 +829,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetString(\a name). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetString.xhtml}{glGetString()}. \since 5.3 @@ -855,7 +840,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetTexParameterfv(\a target, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetTexParameter.xhtml}{glGetTexParameterfv()}. \since 5.3 @@ -866,7 +851,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetTexParameteriv(\a target, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetTexParameter.xhtml}{glGetTexParameteriv()}. \since 5.3 @@ -877,7 +862,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glHint(\a target, \a mode). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glHint.xhtml}{glHint()}. \since 5.3 @@ -888,7 +873,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsEnabled(\a cap). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsEnabled.xhtml}{glIsEnabled()}. \since 5.3 @@ -899,7 +884,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsTexture(\a texture). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsTexture.xhtml}{glIsTexture()}. \since 5.3 @@ -910,7 +895,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glLineWidth(\a width). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glLineWidth.xhtml}{glLineWidth()}. \since 5.3 @@ -921,7 +906,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glPixelStorei(\a pname, \a param). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPixelStorei.xhtml}{glPixelStorei()}. \since 5.3 @@ -932,7 +917,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glPolygonOffset(\a factor, \a units). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPolygonOffset.xhtml}{glPolygonOffset()}. \since 5.3 @@ -943,7 +928,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glReadPixels(\a x, \a y, \a width, \a height, \a format, \a type, \a pixels). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glReadPixels.xhtml}{glReadPixels()}. \since 5.3 @@ -954,7 +939,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glScissor(\a x, \a y, \a width, \a height). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glScissor.xhtml}{glScissor()}. \since 5.3 @@ -965,7 +950,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glStencilFunc(\a func, \a ref, \a mask). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glStencilFunc.xhtml}{glStencilFunc()}. \since 5.3 @@ -976,7 +961,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glStencilMask(\a mask). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glStencilMask.xhtml}{glStencilMask()}. \since 5.3 @@ -987,7 +972,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glStencilOp(\a fail, \a zfail, \a zpass). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glStencilOp.xhtml}{glStencilOp()}. \since 5.3 @@ -998,7 +983,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a format, \a type, \a pixels). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexImage2D.xhtml}{glTexImage2D()}. \since 5.3 @@ -1009,7 +994,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glTexParameterf(\a target, \a pname, \a param). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexParameter.xhtml}{glTexParameterf()}. \since 5.3 @@ -1020,7 +1005,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glTexParameterfv(\a target, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexParameter.xhtml}{glTexParameterfv()}. \since 5.3 @@ -1031,7 +1016,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glTexParameteri(\a target, \a pname, \a param). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexParameter.xhtml}{glTexParameteri()}. \since 5.3 @@ -1042,7 +1027,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glTexParameteriv(\a target, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexParameter.xhtml}{glTexParameteriv()}. \since 5.3 @@ -1053,7 +1038,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a type, \a pixels). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexSubImage2D.xhtml}{glTexSubImage2D()}. \since 5.3 @@ -1064,7 +1049,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glViewport(\a x, \a y, \a width, \a height). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glViewport.xhtml}{glViewport()}. \since 5.3 @@ -1075,7 +1060,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glActiveTexture(\a texture). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glActiveTexture.xhtml}{glActiveTexture()}. */ @@ -1084,7 +1069,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glAttachShader(\a program, \a shader). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glAttachShader.xhtml}{glAttachShader()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1095,7 +1080,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBindAttribLocation(\a program, \a index, \a name). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBindAttribLocation.xhtml}{glBindAttribLocation()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1106,7 +1091,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBindBuffer(\a target, \a buffer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBindBuffer.xhtml}{glBindBuffer()}. */ @@ -1118,7 +1103,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Note that Qt will translate a \a framebuffer argument of 0 to the currently bound QOpenGLContext's defaultFramebufferObject(). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBindFramebuffer.xhtml}{glBindFramebuffer()}. */ @@ -1127,7 +1112,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBindRenderbuffer(\a target, \a renderbuffer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBindRenderbuffer.xhtml}{glBindRenderbuffer()}. */ @@ -1136,7 +1121,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBlendColor(\a red, \a green, \a blue, \a alpha). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendColor.xhtml}{glBlendColor()}. */ @@ -1145,7 +1130,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBlendEquation(\a mode). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendEquation.xhtml}{glBlendEquation()}. */ @@ -1154,7 +1139,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBlendEquationSeparate(\a modeRGB, \a modeAlpha). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendEquationSeparate.xhtml}{glBlendEquationSeparate()}. */ @@ -1163,7 +1148,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBlendFuncSeparate(\a srcRGB, \a dstRGB, \a srcAlpha, \a dstAlpha). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendFuncSeparate.xhtml}{glBlendFuncSeparate()}. */ @@ -1172,7 +1157,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBufferData(\a target, \a size, \a data, \a usage). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBufferData.xhtml}{glBufferData()}. */ @@ -1181,7 +1166,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glBufferSubData(\a target, \a offset, \a size, \a data). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBufferSubData.xhtml}{glBufferSubData()}. */ @@ -1190,7 +1175,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCheckFramebufferStatus(\a target). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCheckFramebufferStatus.xhtml}{glCheckFramebufferStatus()}. */ @@ -1201,7 +1186,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() desktop OpenGL systems and glClearDepthf(\a depth) on embedded OpenGL ES systems. - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glClearDepthf.xhtml}{glClearDepthf()}. */ @@ -1210,7 +1195,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCompileShader(\a shader). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCompileShader.xhtml}{glCompileShader()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1221,7 +1206,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCompressedTexImage2D(\a target, \a level, \a internalformat, \a width, \a height, \a border, \a imageSize, \a data). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCompressedTexImage2D.xhtml}{glCompressedTexImage2D()}. */ @@ -1230,7 +1215,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCompressedTexSubImage2D(\a target, \a level, \a xoffset, \a yoffset, \a width, \a height, \a format, \a imageSize, \a data). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCompressedTexSubImage2D.xhtml}{glCompressedTexSubImage2D()}. */ @@ -1239,7 +1224,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCreateProgram(). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCreateProgram.xhtml}{glCreateProgram()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1250,7 +1235,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glCreateShader(\a type). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCreateShader.xhtml}{glCreateShader()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1261,7 +1246,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDeleteBuffers(\a n, \a buffers). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDeleteBuffers.xhtml}{glDeleteBuffers()}. */ @@ -1270,7 +1255,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDeleteFramebuffers(\a n, \a framebuffers). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDeleteFramebuffers.xhtml}{glDeleteFramebuffers()}. */ @@ -1279,7 +1264,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDeleteProgram(\a program). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDeleteProgram.xhtml}{glDeleteProgram()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1290,7 +1275,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDeleteRenderbuffers(\a n, \a renderbuffers). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDeleteRenderbuffers.xhtml}{glDeleteRenderbuffers()}. */ @@ -1299,7 +1284,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDeleteShader(\a shader). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDeleteShader.xhtml}{glDeleteShader()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1312,7 +1297,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() desktop OpenGL systems and glDepthRangef(\a zNear, \a zFar) on embedded OpenGL ES systems. - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDepthRangef.xhtml}{glDepthRangef()}. */ @@ -1321,7 +1306,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDetachShader(\a program, \a shader). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDetachShader.xhtml}{glDetachShader()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1332,8 +1317,8 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glDisableVertexAttribArray(\a index). - For more information, see the OpenGL ES 2.0 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es2.0/html/glDisableVertexAttribArray.xhtml}{glDisableVertexAttribArray()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEnableVertexAttribArray.xhtml}{glDisableVertexAttribArray()}. This convenience function will do nothing on OpenGL ES 1.x systems. */ @@ -1343,7 +1328,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glEnableVertexAttribArray(\a index). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEnableVertexAttribArray.xhtml}{glEnableVertexAttribArray()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1354,7 +1339,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glFramebufferRenderbuffer(\a target, \a attachment, \a renderbuffertarget, \a renderbuffer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glFramebufferRenderbuffer.xhtml}{glFramebufferRenderbuffer()}. */ @@ -1363,7 +1348,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glFramebufferTexture2D(\a target, \a attachment, \a textarget, \a texture, \a level). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glFramebufferTexture2D.xhtml}{glFramebufferTexture2D()}. */ @@ -1372,7 +1357,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGenBuffers(\a n, \a buffers). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGenBuffers.xhtml}{glGenBuffers()}. */ @@ -1381,7 +1366,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGenerateMipmap(\a target). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGenerateMipmap.xhtml}{glGenerateMipmap()}. */ @@ -1390,7 +1375,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGenFramebuffers(\a n, \a framebuffers). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGenFramebuffers.xhtml}{glGenFramebuffers()}. */ @@ -1399,7 +1384,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGenRenderbuffers(\a n, \a renderbuffers). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGenRenderbuffers.xhtml}{glGenRenderbuffers()}. */ @@ -1408,7 +1393,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetActiveAttrib(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetActiveAttrib.xhtml}{glGetActiveAttrib()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1419,7 +1404,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetActiveUniform(\a program, \a index, \a bufsize, \a length, \a size, \a type, \a name). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetActiveUniform.xhtml}{glGetActiveUniform()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1430,7 +1415,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetAttachedShaders(\a program, \a maxcount, \a count, \a shaders). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetAttachedShaders.xhtml}{glGetAttachedShaders()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1441,7 +1426,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetAttribLocation(\a program, \a name). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetAttribLocation.xhtml}{glGetAttribLocation()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1452,8 +1437,8 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetBufferParameteriv(\a target, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetBufferParameteriv.xhtml}{glGetBufferParameteriv()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetBufferParameter.xhtml}{glGetBufferParameteriv()}. */ /*! @@ -1461,7 +1446,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetFramebufferAttachmentParameteriv(\a target, \a attachment, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetFramebufferAttachmentParameteriv.xhtml}{glGetFramebufferAttachmentParameteriv()}. */ @@ -1470,7 +1455,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetProgramiv(\a program, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetProgramiv.xhtml}{glGetProgramiv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1481,7 +1466,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetProgramInfoLog(\a program, \a bufsize, \a length, \a infolog). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetProgramInfoLog.xhtml}{glGetProgramInfoLog()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1492,7 +1477,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetRenderbufferParameteriv(\a target, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetRenderbufferParameteriv.xhtml}{glGetRenderbufferParameteriv()}. */ @@ -1501,7 +1486,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetShaderiv(\a shader, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetShaderiv.xhtml}{glGetShaderiv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1512,7 +1497,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetShaderInfoLog(\a shader, \a bufsize, \a length, \a infolog). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetShaderInfoLog.xhtml}{glGetShaderInfoLog()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1523,7 +1508,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetShaderPrecisionFormat(\a shadertype, \a precisiontype, \a range, \a precision). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetShaderPrecisionFormat.xhtml}{glGetShaderPrecisionFormat()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1534,7 +1519,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetShaderSource(\a shader, \a bufsize, \a length, \a source). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetShaderSource.xhtml}{glGetShaderSource()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1545,7 +1530,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetUniformfv(\a program, \a location, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetUniform.xhtml}{glGetUniformfv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1556,7 +1541,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetUniformiv(\a program, \a location, \a params). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetUniform.xhtml}{glGetUniformiv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1567,7 +1552,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetUniformLocation(\a program, \a name). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetUniformLocation.xhtml}{glGetUniformLocation()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1578,8 +1563,8 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetVertexAttribfv(\a index, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetVertexAttribfv.xhtml}{glGetVertexAttribfv()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetVertexAttrib.xhtml}{glGetVertexAttribfv()}. This convenience function will do nothing on OpenGL ES 1.x systems. */ @@ -1589,8 +1574,8 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetVertexAttribiv(\a index, \a pname, \a params). - For more information, see the OpenGL ES 2.0 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetVertexAttribiv.xhtml}{glGetVertexAttribiv()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetVertexAttrib.xhtml}{glGetVertexAttribiv()}. This convenience function will do nothing on OpenGL ES 1.x systems. */ @@ -1600,7 +1585,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glGetVertexAttribPointerv(\a index, \a pname, \a pointer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetVertexAttribPointerv.xhtml}{glGetVertexAttribPointerv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1611,7 +1596,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsBuffer(\a buffer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsBuffer.xhtml}{glIsBuffer()}. */ @@ -1620,7 +1605,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsFramebuffer(\a framebuffer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsFramebuffer.xhtml}{glIsFramebuffer()}. */ @@ -1629,7 +1614,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsProgram(\a program). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsProgram.xhtml}{glIsProgram()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1640,7 +1625,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsRenderbuffer(\a renderbuffer). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsRenderbuffer.xhtml}{glIsRenderbuffer()}. */ @@ -1649,7 +1634,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glIsShader(\a shader). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsShader.xhtml}{glIsShader()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1660,7 +1645,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glLinkProgram(\a program). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glLinkProgram.xhtml}{glLinkProgram()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1671,7 +1656,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glReleaseShaderCompiler(). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glReleaseShaderCompiler.xhtml}{glReleaseShaderCompiler()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1682,7 +1667,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glRenderbufferStorage(\a target, \a internalformat, \a width, \a height). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glRenderbufferStorage.xhtml}{glRenderbufferStorage()}. */ @@ -1691,7 +1676,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glSampleCoverage(\a value, \a invert). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glSampleCoverage.xhtml}{glSampleCoverage()}. */ @@ -1700,7 +1685,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glShaderBinary(\a n, \a shaders, \a binaryformat, \a binary, \a length). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glShaderBinary.xhtml}{glShaderBinary()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1711,7 +1696,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glShaderSource(\a shader, \a count, \a string, \a length). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glShaderSource.xhtml}{glShaderSource()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1722,7 +1707,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glStencilFuncSeparate(\a face, \a func, \a ref, \a mask). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glStencilFuncSeparate.xhtml}{glStencilFuncSeparate()}. */ @@ -1731,7 +1716,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glStencilMaskSeparate(\a face, \a mask). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glStencilMaskSeparate.xhtml}{glStencilMaskSeparate()}. */ @@ -1740,7 +1725,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glStencilOpSeparate(\a face, \a fail, \a zfail, \a zpass). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glStencilOpSeparate.xhtml}{glStencilOpSeparate()}. */ @@ -1749,7 +1734,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform1f(\a location, \a x). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform1f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1760,7 +1745,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform1fv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform1fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1771,7 +1756,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform1i(\a location, \a x). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform1i()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1782,7 +1767,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform1iv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform1iv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1793,7 +1778,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform2f(\a location, \a x, \a y). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform2f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1804,7 +1789,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform2fv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform2fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1815,7 +1800,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform2i(\a location, \a x, \a y). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform2i()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1826,7 +1811,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform2iv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform2iv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1837,7 +1822,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform3f(\a location, \a x, \a y, \a z). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform3f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1848,7 +1833,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform3fv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform3fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1859,7 +1844,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform3i(\a location, \a x, \a y, \a z). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform3i()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1870,7 +1855,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform3iv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform3iv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1881,7 +1866,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform4f(\a location, \a x, \a y, \a z, \a w). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform4f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1892,7 +1877,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform4fv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform4fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1903,7 +1888,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform4i(\a location, \a x, \a y, \a z, \a w). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform4i()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1914,7 +1899,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniform4iv(\a location, \a count, \a v). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniform4iv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1925,7 +1910,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniformMatrix2fv(\a location, \a count, \a transpose, \a value). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniformMatrix2fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1936,7 +1921,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniformMatrix3fv(\a location, \a count, \a transpose, \a value). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniformMatrix3fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1947,7 +1932,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUniformMatrix4fv(\a location, \a count, \a transpose, \a value). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUniform.xhtml}{glUniformMatrix4fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1958,7 +1943,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glUseProgram(\a program). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUseProgram.xhtml}{glUseProgram()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1969,7 +1954,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glValidateProgram(\a program). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glValidateProgram.xhtml}{glValidateProgram()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1980,7 +1965,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib1f(\a indx, \a x). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib1f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -1991,7 +1976,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib1fv(\a indx, \a values). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib1fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2002,7 +1987,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib2f(\a indx, \a x, \a y). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib2f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2013,7 +1998,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib2fv(\a indx, \a values). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib2fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2024,7 +2009,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib3f(\a indx, \a x, \a y, \a z). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib3f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2035,7 +2020,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib3fv(\a indx, \a values). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib3fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2046,7 +2031,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib4f(\a indx, \a x, \a y, \a z, \a w). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib4f()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2057,7 +2042,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttrib4fv(\a indx, \a values). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttrib.xhtml}{glVertexAttrib4fv()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2068,7 +2053,7 @@ void QOpenGLFunctions::initializeOpenGLFunctions() Convenience function that calls glVertexAttribPointer(\a indx, \a size, \a type, \a normalized, \a stride, \a ptr). - For more information, see the OpenGL ES 2.0 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttribPointer.xhtml}{glVertexAttribPointer()}. This convenience function will do nothing on OpenGL ES 1.x systems. @@ -2563,7 +2548,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) function either in core or as an extension. For more information, see the OpenGL ES 3.x documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEndQuery.xhtml}{glEndQuery()}. + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBeginQuery.xhtml}{glEndQuery()}. */ /*! @@ -2576,7 +2561,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) function either in core or as an extension. For more information, see the OpenGL ES 3.x documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEndTransformFeedback.xhtml}{glEndTransformFeedback()}. + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBeginTransformFeedback.xhtml}{glEndTransformFeedback()}. */ /*! @@ -3473,7 +3458,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) function either in core or as an extension. For more information, see the OpenGL ES 3.x documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glUnmapBuffer.xhtml}{glUnmapBuffer()}. + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glMapBufferRange.xhtml}{glUnmapBuffer()}. */ /*! @@ -3629,7 +3614,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) function either in core or as an extension. For more information, see the OpenGL ES 3.x documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCreateShaderProgramv.xhtml}{glCreateShaderProgramv()}. + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCreateShaderProgram.xhtml}{glCreateShaderProgramv()}. */ /*! @@ -4435,7 +4420,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) function either in core or as an extension. For more information, see the OpenGL ES 3.x documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttribIFormat.xhtml}{glVertexAttribIFormat()}. + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glVertexAttribFormat.xhtml}{glVertexAttribIFormat()}. */ /*! @@ -4460,7 +4445,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendBarrier.xhtml}{glBlendBarrier()}. */ @@ -4473,7 +4458,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendEquationSeparate.xhtml}{glBlendEquationSeparatei()}. */ @@ -4486,8 +4471,8 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendEquationi.xhtml}{glBlendEquationi()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendEquation.xhtml}{glBlendEquationi()}. */ /*! @@ -4499,7 +4484,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendFuncSeparate.xhtml}{glBlendFuncSeparatei()}. */ @@ -4512,8 +4497,8 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendFunci.xhtml}{glBlendFunci()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glBlendFunc.xhtml}{glBlendFunci()}. */ /*! @@ -4525,7 +4510,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glColorMask.xhtml}{glColorMaski()}. */ @@ -4538,7 +4523,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glCopyImageSubData.xhtml}{glCopyImageSubData()}. */ @@ -4551,7 +4536,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDebugMessageCallback.xhtml}{glDebugMessageCallback()}. */ @@ -4564,7 +4549,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDebugMessageControl.xhtml}{glDebugMessageContro()}. */ @@ -4577,7 +4562,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDebugMessageInsert.xhtml}{glDebugMessageInsert()}. */ @@ -4590,7 +4575,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glEnable.xhtml}{glDisablei()}. */ @@ -4603,7 +4588,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDrawElementsBaseVertex.xhtml}{glDrawElementsBaseVerte()}. */ @@ -4616,7 +4601,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDrawElementsInstancedBaseVertex.xhtml}{glDrawElementsInstancedBaseVerte()}. */ @@ -4629,7 +4614,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glDrawRangeElementsBaseVertex.xhtml}{glDrawRangeElementsBaseVerte()}. */ @@ -4642,8 +4627,8 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for - \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEnablei.xhtml}{glEnablei()}. + For more information, see the OpenGL ES 3.X documentation for + \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glEnable.xhtml}{glEnablei()}. */ /*! @@ -4655,7 +4640,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glFramebufferTexture.xhtml}{glFramebufferTexture()}. */ @@ -4668,7 +4653,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetDebugMessageLog.xhtml}{glGetDebugMessageLog()}. */ @@ -4681,7 +4666,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetGraphicsResetStatus.xhtml}{glGetGraphicsResetStatus()}. */ @@ -4694,7 +4679,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetObjectLabel.xhtml}{glGetObjectLabe()}. */ @@ -4707,7 +4692,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetObjectPtrLabel.xhtml}{glGetObjectPtrLabe()}. */ @@ -4720,7 +4705,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetPointerv.xhtml}{glGetPointerv()}. */ @@ -4733,7 +4718,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetSamplerParameter.xhtml}{glGetSamplerParameterIiv()}. */ @@ -4746,7 +4731,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetSamplerParameter.xhtml}{glGetSamplerParameterIuiv()}. */ @@ -4759,7 +4744,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetTexParameter.xhtml}{glGetTexParameterIiv()}. */ @@ -4772,7 +4757,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetTexParameter.xhtml}{glGetTexParameterIuiv()}. */ @@ -4785,7 +4770,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetUniform.xhtml}{glGetnUniformfv()}. */ @@ -4798,7 +4783,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetUniform.xhtml}{glGetnUniformiv()}. */ @@ -4811,7 +4796,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glGetUniform.xhtml}{glGetnUniformuiv()}. */ @@ -4824,7 +4809,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glIsEnabled.xhtml}{glIsEnabledi()}. */ @@ -4837,7 +4822,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glMinSampleShading.xhtml}{glMinSampleShading()}. */ @@ -4850,7 +4835,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glObjectLabel.xhtml}{glObjectLabe()}. */ @@ -4863,7 +4848,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glObjectPtrLabel.xhtml}{glObjectPtrLabe()}. */ @@ -4876,7 +4861,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPatchParameteri.xhtml}{glPatchParameteri()}. */ @@ -4889,7 +4874,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPopDebugGroup.xhtml}{glPopDebugGroup()}. */ @@ -4902,7 +4887,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPrimitiveBoundingBox.xhtml}{glPrimitiveBoundingBo()}. */ @@ -4915,7 +4900,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glPushDebugGroup.xhtml}{glPushDebugGroup()}. */ @@ -4928,7 +4913,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glReadPixels.xhtml}{glReadnPixels()}. */ @@ -4941,7 +4926,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glSamplerParameter.xhtml}{glSamplerParameterIiv()}. */ @@ -4954,7 +4939,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glSamplerParameter.xhtml}{glSamplerParameterIuiv()}. */ @@ -4967,7 +4952,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexBuffer.xhtml}{glTexBuffer()}. */ @@ -4980,7 +4965,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexBufferRange.xhtml}{glTexBufferRange()}. */ @@ -4993,7 +4978,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexParameter.xhtml}{glTexParameterIiv()}. */ @@ -5006,7 +4991,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexParameter.xhtml}{glTexParameterIuiv()}. */ @@ -5019,7 +5004,7 @@ QT_OPENGL_IMPLEMENT(QOpenGLFunctionsPrivate, QT_OPENGL_FUNCTIONS) with plain OpenGL, the function is only usable when the given profile and version contains the function either in core or as an extension. - For more information, see the OpenGL ES 3.2 documentation for + For more information, see the OpenGL ES 3.X documentation for \l{https://www.khronos.org/registry/OpenGL-Refpages/es3/html/glTexStorage3DMultisample.xhtml}{glTexStorage3DMultisample()}. */ @@ -5070,7 +5055,23 @@ QOpenGLExtensionsPrivate::QOpenGLExtensionsPrivate(QOpenGLContext *ctx) MapBuffer = RESOLVE(MapBuffer); GetBufferSubData = RESOLVE(GetBufferSubData); DiscardFramebuffer = RESOLVE(DiscardFramebuffer); - } +} + +void QOpenGLExtensions::discardFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments) +{ + Q_D(QOpenGLExtensions); + Q_ASSERT(QOpenGLExtensions::isInitialized(d)); + Q_ASSERT(d->f.InvalidateFramebuffer || d->DiscardFramebuffer); + + // On GLES >= 3 we prefer glInvalidateFramebuffer, even if the + // discard extension is present + if (d->f.InvalidateFramebuffer) + d->f.InvalidateFramebuffer(target, numAttachments, attachments); + else + d->DiscardFramebuffer(target, numAttachments, attachments); + + Q_OPENGL_FUNCTIONS_DEBUG +} void QOpenGLExtensions::flushShared() { diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index 76552cdd0e..05435903fb 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QOPENGLFUNCTIONS_H #define QOPENGLFUNCTIONS_H @@ -68,7 +32,7 @@ typedef double GLdouble; unsigned clamped = qMin(unsigned(error - GL_INVALID_ENUM), 4U); \ const char *errors[] = { "GL_INVALID_ENUM", "GL_INVALID_VALUE", "GL_INVALID_OPERATION", "Unknown" }; \ printf("GL error at %s:%d: %s\n", __FILE__, __LINE__, errors[clamped]); \ - int *value = 0; \ + int *value = nullptr; \ *value = 0; \ } #else @@ -227,7 +191,7 @@ struct QOpenGLFunctionsPrivate; #undef glTexLevelParameteriv -#if defined(Q_CLANG_QDOC) +#if defined(Q_QDOC) #undef GLbitfield typedef unsigned int GLbitfield; #undef GLchar diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp index 631c3d151b..28b09b553a 100644 --- a/src/gui/opengl/qopenglprogrambinarycache.cpp +++ b/src/gui/opengl/qopenglprogrambinarycache.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 "qopenglprogrambinarycache_p.h" #include <QOpenGLContext> @@ -54,6 +18,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + Q_LOGGING_CATEGORY(lcOpenGLProgramDiskCache, "qt.opengl.diskcache") #ifndef GL_CONTEXT_LOST @@ -117,22 +83,26 @@ static inline bool qt_ensureWritableDir(const QString &name) QOpenGLProgramBinaryCache::QOpenGLProgramBinaryCache() : m_cacheWritable(false) { - const QString subPath = QLatin1String("/qtshadercache-") + QSysInfo::buildAbi() + QLatin1Char('/'); + const QString subPath = "/qtshadercache-"_L1 + QSysInfo::buildAbi() + u'/'; const QString sharedCachePath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); + m_globalCacheDir = sharedCachePath + subPath; + m_localCacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + subPath; + if (!sharedCachePath.isEmpty()) { - m_cacheDir = sharedCachePath + subPath; - m_cacheWritable = qt_ensureWritableDir(m_cacheDir); + m_currentCacheDir = m_globalCacheDir; + m_cacheWritable = qt_ensureWritableDir(m_currentCacheDir); } if (!m_cacheWritable) { - m_cacheDir = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + subPath; - m_cacheWritable = qt_ensureWritableDir(m_cacheDir); + m_currentCacheDir = m_localCacheDir; + m_cacheWritable = qt_ensureWritableDir(m_currentCacheDir); } - qCDebug(lcOpenGLProgramDiskCache, "Cache location '%s' writable = %d", qPrintable(m_cacheDir), m_cacheWritable); + + qCDebug(lcOpenGLProgramDiskCache, "Cache location '%s' writable = %d", qPrintable(m_currentCacheDir), m_cacheWritable); } QString QOpenGLProgramBinaryCache::cacheFileName(const QByteArray &cacheKey) const { - return m_cacheDir + QString::fromUtf8(cacheKey); + return m_currentCacheDir + QString::fromUtf8(cacheKey); } #define BASE_HEADER_SIZE (int(4 * sizeof(quint32))) @@ -361,6 +331,25 @@ static inline void writeStr(uchar **p, const QByteArray &str) *p += str.size(); } +static inline bool writeFile(const QString &filename, const QByteArray &data) +{ +#if QT_CONFIG(temporaryfile) + QSaveFile f(filename); + if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + f.write(data); + if (f.commit()) + return true; + } +#else + QFile f(filename); + if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + if (f.write(data) == data.length()) + return true; + } +#endif + return false; +} + void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId) { if (!m_cacheWritable) @@ -427,20 +416,20 @@ void QOpenGLProgramBinaryCache::save(const QByteArray &cacheKey, uint programId) writeUInt(&blobFormatPtr, blobFormat); -#if QT_CONFIG(temporaryfile) - QSaveFile f(cacheFileName(cacheKey)); - if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - f.write(blob); - if (!f.commit()) -#else - QFile f(cacheFileName(cacheKey)); - if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - if (f.write(blob) < blob.length()) -#endif - qCDebug(lcOpenGLProgramDiskCache, "Failed to write %s to shader cache", qPrintable(f.fileName())); - } else { - qCDebug(lcOpenGLProgramDiskCache, "Failed to create %s in shader cache", qPrintable(f.fileName())); + QString filename = cacheFileName(cacheKey); + bool ok = writeFile(filename, blob); + if (!ok && m_currentCacheDir == m_globalCacheDir) { + m_currentCacheDir = m_localCacheDir; + m_cacheWritable = qt_ensureWritableDir(m_currentCacheDir); + qCDebug(lcOpenGLProgramDiskCache, "Cache location changed to '%s' writable = %d", + qPrintable(m_currentCacheDir), m_cacheWritable); + if (m_cacheWritable) { + filename = cacheFileName(cacheKey); + ok = writeFile(filename, blob); + } } + if (!ok) + qCDebug(lcOpenGLProgramDiskCache, "Failed to write %s to shader cache", qPrintable(filename)); } #if QT_CONFIG(opengles2) diff --git a/src/gui/opengl/qopenglprogrambinarycache_p.h b/src/gui/opengl/qopenglprogrambinarycache_p.h index d8fdf1d8c5..6a636fcf56 100644 --- a/src/gui/opengl/qopenglprogrambinarycache_p.h +++ b/src/gui/opengl/qopenglprogrambinarycache_p.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui 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 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 QOPENGLPROGRAMBINARYCACHE_P_H #define QOPENGLPROGRAMBINARYCACHE_P_H @@ -56,7 +20,7 @@ #include <QtCore/qmutex.h> #include <QtCore/QLoggingCategory> #include <QtGui/private/qopenglcontext_p.h> -#include <QtGui/private/qshader_p.h> +#include <rhi/qshader.h> QT_BEGIN_NAMESPACE @@ -64,7 +28,7 @@ QT_BEGIN_NAMESPACE // therefore stay independent from QOpenGLShader(Program). Must rely only on // QOpenGLContext/Functions. -Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcOpenGLProgramDiskCache) +QT_DECLARE_EXPORTED_QT_LOGGING_CATEGORY(lcOpenGLProgramDiskCache, Q_GUI_EXPORT) class Q_GUI_EXPORT QOpenGLProgramBinaryCache { @@ -92,7 +56,9 @@ private: bool verifyHeader(const QByteArray &buf) const; bool setProgramBinary(uint programId, uint blobFormat, const void *p, uint blobSize); - QString m_cacheDir; + QString m_globalCacheDir; + QString m_localCacheDir; + QString m_currentCacheDir; bool m_cacheWritable; struct MemCacheEntry { MemCacheEntry(const void *p, int size, uint format) diff --git a/src/gui/opengl/qt_attribution.json b/src/gui/opengl/qt_attribution.json index d3ff10d803..44310980e2 100644 --- a/src/gui/opengl/qt_attribution.json +++ b/src/gui/opengl/qt_attribution.json @@ -5,7 +5,7 @@ "QDocModule": "qtgui", "Description": "OpenGL header generated from the Khronos OpenGL / OpenGL ES XML API Registry.", "QtUsage": "Used on Windows and Linux in the OpenGL related headers of Qt GUI.", - "Path": "qopenglext.h", + "Files": "qopenglext.h", "Homepage": "https://www.khronos.org/", "Version": "Revision 27684", @@ -20,7 +20,7 @@ "QDocModule": "qtgui", "Description": "OpenGL ES 2 header generated from the Khronos OpenGL / OpenGL ES XML API Registry.", "QtUsage": "Used on Windows and Linux in the OpenGL related headers of Qt GUI.", - "Path": "qopengles2ext.h", + "Files": "qopengles2ext.h", "Homepage": "https://www.khronos.org/", "Version": "Revision 27673", |