Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9, 5.10.1, 5.10, 5.11
-
None
-
fa091640134b3ff99a9eb92df8286d15203122bf
Description
Reported in freedesktop.org bug: https://bugs.freedesktop.org/show_bug.cgi?id=105065
When glProgramBinary() results in LINK_STATUS = FALSE, this path through the code causes an empty program to be linked instead of with the provided shaders:
1) qopenglshaderprogram.cpp:3825: if (binCache.load(cacheKey, q->programId())) {
does glProgramBinary(). Mesa doesn't like the binary and sets the link
status to failure.
2) qopenglshaderprogram.cpp:3825: bool ok = q->link();
To check link status
3) qopenglshaderprogram.cpp:1297: d->glfuncs->glGetProgramiv(program, GL_LINK_STATUS, &value);
Sees that glProgramBinary set link status to failed.
4) qopenglshaderprogram.cpp:1303: d->glfuncs->glLinkProgram(program);
Links the program, however no shaders have been attached. Because a
compat context is being used, this is valid and linking succeeds.
5) qopenglshaderprogram.cpp:1324: return d->linked;
returns true;
6) qopenglshaderprogram.cpp:3831: needsCompile = false;
Won't try to compile, have a program with no shaders at this point.
Attachments
Issue Links
- is duplicated by
-
QTBUG-66348 Invalid shaders created when glProgramBinary fails
- Closed
For Gerrit Dashboard: QTBUG-66420 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
220352,1 | Avoid program without shaders when glProgramBinary fails | 5.11 | qt/qtbase | Status: ABANDONED | 0 | 0 |
220412,5 | opengl: Bail if cached shader fails to load | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |
221098,2 | opengl: Bail if cached shader fails to load | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |