summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-12-06 14:54:29 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-12-07 08:04:28 +0000
commit17d1ae7b4d35d0698d307a3a21cd4ad2c21fc361 (patch)
treeb047f440ebc171c211abb2227876e6c99f1a0f38 /src
parent56bf0a9c8f06b6a38a35c03469b341138336c108 (diff)
Warn if uint index type is not supported on ES2
Instead of crypic "GL error after drawing mesh: 500" errors recognize the situation and show a warning (once) to let the user know what is wrong. Unfortunately this is still common on devices like the RPi. Change-Id: Id7ef38cebdb84c4d89ea6d48ede80f253fd60371 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/render/graphicshelpers/graphicshelperes2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/render/graphicshelpers/graphicshelperes2.cpp b/src/render/graphicshelpers/graphicshelperes2.cpp
index 1daac7f9f..8d1df2253 100644
--- a/src/render/graphicshelpers/graphicshelperes2.cpp
+++ b/src/render/graphicshelpers/graphicshelperes2.cpp
@@ -38,6 +38,7 @@
#include <Qt3DRender/private/renderlogging_p.h>
#include <private/attachmentpack_p.h>
#include <private/qgraphicsutils_p.h>
+#include <QtGui/private/qopenglextensions_p.h>
QT_BEGIN_NAMESPACE
@@ -119,6 +120,15 @@ void GraphicsHelperES2::drawElements(GLenum primitiveType,
{
if (baseVertex != 0)
qWarning() << "glDrawElementsBaseVertex is not supported with OpenGL ES 2";
+ QOpenGLExtensions *xfuncs = static_cast<QOpenGLExtensions *>(m_funcs);
+ if (indexType == GL_UNSIGNED_INT && !xfuncs->hasOpenGLExtension(QOpenGLExtensions::ElementIndexUint)) {
+ static bool warnShown = false;
+ if (!warnShown) {
+ warnShown = true;
+ qWarning("GL_UNSIGNED_INT index type not supported on this system, skipping draw call.");
+ }
+ return;
+ }
m_funcs->glDrawElements(primitiveType,
primitiveCount,
indexType,