From 7bd7bf9313c93a3eba8744521cd9ff9f329e45cb Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 24 Feb 2018 01:55:31 +0300 Subject: =?UTF-8?q?=09=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB:=20=20=20=20dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch?= =?UTF-8?q?=20=09=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?:=20=20=20=20dev-qt/qtwebengine/files/qtwebengine-5.10.0-jpeg-9?= =?UTF-8?q?.patch=20=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB:=20=20=20=20dev-qt/qtwebengine/files/qtwebengine-5.9.3-i?= =?UTF-8?q?cu-60.1.patch=20=09=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB:=20=20=20=20dev-qt/qtwebengine/files/qtweben?= =?UTF-8?q?gine-5.9.3-paxmark-mksnapshot.patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch | 87 +++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch (limited to 'dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch') diff --git a/dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch b/dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch new file mode 100644 index 0000000..2a44741 --- /dev/null +++ b/dev-qt/qtgui/files/qtgui-5.9.4-opengl.patch @@ -0,0 +1,87 @@ +From b63aeba4a88088c7de61c1664a510c02d38ade84 Mon Sep 17 00:00:00 2001 +From: Antonio Larrosa +Date: Fri, 16 Feb 2018 13:18:42 +0100 +Subject: [PATCH] opengl: Bail if cached shader fails to load + +QOpenGLProgramBinaryCache::setProgramBinary() should check +GL_LINK_STATUS after glProgramBinary(), but doesn't. + +In practice, this means that SDDM is a white screen, and KDE is just +a gray task bar. + +So far, Qt tries to check this using its internal ::link() function. +But in case the cached binary fails to load, Qt currently attempts to +link the inexistent program, resulting in a zero-length, fixed +pipeline shader. + +Checking this already in ::setProgramBinary() makes the call to +::link() superfluous, so we remove that as well. + +Done-with: Max Staudt +Done-with: Michal Srb +Done-with: Fabian Vogt +Task-number: QTBUG-66420 +Change-Id: Iabb51d0eb2c0c16bde696efff623e57d15f28d82 +Reviewed-by: Jesus Fernandez +Reviewed-by: Laszlo Agocs +(cherry picked from commit fa091640134b3ff99a9eb92df8286d15203122bf) +--- + src/gui/opengl/qopenglprogrambinarycache.cpp | 20 ++++++++++++++++++-- + src/gui/opengl/qopenglshaderprogram.cpp | 8 +------- + 2 files changed, 19 insertions(+), 9 deletions(-) + +diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp +index 06373e1..d16173d 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 cc8af16..3b82bac 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; +-- +2.7.4 + -- cgit v1.2.3