diff options
author | Christian Andersen <csandersen3@gmail.com> | 2018-10-21 14:53:33 +0200 |
---|---|---|
committer | Christian Andersen <csandersen3@gmail.com> | 2018-10-22 17:49:03 +0000 |
commit | 3bc2e44bd387aa2185083fcf94eeee67f37380f3 (patch) | |
tree | 70c78eb0e62dcd68060e66725a2389b62de79f41 /src/render/renderers/opengl/textures | |
parent | 62a30edbd5b61e1b9dd5eca119710c5a54d6e803 (diff) |
Don't trigger Q_UNREACHABLE if passed invalid render buffer formats
Adds warning printout of the format that triggered the error. The
graphics card may produce a proper image, but readFrameBuffer doesn't
know how to interpret it. Additionally adds printout of the format when
the code doesn't know the equivalent OpenGL ES 2.0 format.
Fixes: QTBUG-66515
Change-Id: I65559f7d397a9297521ae0b1ebaf120629be3873
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/renderers/opengl/textures')
-rw-r--r-- | src/render/renderers/opengl/textures/gltexture.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/render/renderers/opengl/textures/gltexture.cpp b/src/render/renderers/opengl/textures/gltexture.cpp index e98f3965d..cb83e9c1e 100644 --- a/src/render/renderers/opengl/textures/gltexture.cpp +++ b/src/render/renderers/opengl/textures/gltexture.cpp @@ -40,6 +40,7 @@ #include <QtCore/qhash.h> #include "gltexture_p.h" +#include <private/qdebug_p.h> #include <QDebug> #include <QOpenGLFunctions> #include <QOpenGLTexture> @@ -383,7 +384,9 @@ QOpenGLTexture *GLTexture::buildGLTexture() format = QAbstractTexture::DepthFormat; break; default: - qWarning() << Q_FUNC_INFO << "could not find a matching OpenGL ES 2.0 unsized texture format"; + auto warning = qWarning(); + warning << "Could not find a matching OpenGL ES 2.0 texture format:"; + QtDebugUtils::formatQEnum(warning, m_properties.format); break; } } |