summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/opengl/qopenglprogrambinarycache.cpp20
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp8
2 files changed, 19 insertions, 9 deletions
diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp
index 06373e1113..d16173df83 100644
--- a/src/gui/opengl/qopenglprogrambinarycache.cpp
+++ b/src/gui/opengl/qopenglprogrambinarycache.cpp
@@ -161,10 +161,26 @@ bool QOpenGLProgramBinaryCache::setProgramBinary(uint programId, uint blobFormat
QOpenGLExtraFunctions *funcs = QOpenGLContext::currentContext()->extraFunctions();
while (funcs->glGetError() != GL_NO_ERROR) { }
funcs->glProgramBinary(programId, blobFormat, p, blobSize);
- int err = funcs->glGetError();
+
+ GLenum err = funcs->glGetError();
+ if (err != GL_NO_ERROR) {
+ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
+ "format 0x%x, err = 0x%x",
+ programId, blobSize, blobFormat, err);
+ return false;
+ }
+ GLint linkStatus = 0;
+ funcs->glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus);
+ if (linkStatus != GL_TRUE) {
+ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
+ "format 0x%x, linkStatus = 0x%x, err = 0x%x",
+ programId, blobSize, blobFormat, linkStatus, err);
+ return false;
+ }
+
qCDebug(DBG_SHADER_CACHE, "Program binary set for program %u, size %d, format 0x%x, err = 0x%x",
programId, blobSize, blobFormat, err);
- return err == 0;
+ return true;
}
#ifdef Q_OS_UNIX
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index cc8af16bfe..3b82baccb3 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -3824,13 +3824,7 @@ bool QOpenGLShaderProgramPrivate::linkBinary()
bool needsCompile = true;
if (binCache.load(cacheKey, q->programId())) {
qCDebug(DBG_SHADER_CACHE, "Program binary received from cache");
- linkBinaryRecursion = true;
- bool ok = q->link();
- linkBinaryRecursion = false;
- if (ok)
- needsCompile = false;
- else
- qCDebug(DBG_SHADER_CACHE, "Link failed after glProgramBinary");
+ needsCompile = false;
}
bool needsSave = false;