diff options
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgmaterial.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgmaterial.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp index 22fe29959e..376aeb2423 100644 --- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp +++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp @@ -46,6 +46,21 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_DEBUG +bool qsg_material_failure = false; +bool qsg_test_and_clear_material_failure() +{ + bool fail = qsg_material_failure; + qsg_material_failure = false; + return fail; +} + +void qsg_set_material_failure() +{ + qsg_material_failure = true; +} +#endif + const char *QSGMaterialShaderPrivate::loadShaderSource(QOpenGLShader::ShaderType type) const { QStringList files = m_sourceFiles[type]; @@ -346,7 +361,8 @@ void QSGMaterialShader::compile() char const *const *attr = attributeNames(); #ifndef QT_NO_DEBUG int maxVertexAttribs = 0; - glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); + QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); + funcs->glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs); for (int i = 0; attr[i]; ++i) { if (i >= maxVertexAttribs) { qFatal("List of attribute names is either too long or not null-terminated.\n" |