Last Comment Bug 777883 - Avoid calling glLinkProgram when we know that a bad shader is attached
: Avoid calling glLinkProgram when we know that a bad shader is attached
Status: RESOLVED FIXED
webgl-conformance
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla17
Assigned To: Benoit Jacob [:bjacob] (mostly away)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-26 13:13 PDT by Benoit Jacob [:bjacob] (mostly away)
Modified: 2012-07-27 08:58 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
glLinkProgram work-around (8.24 KB, patch)
2012-07-26 13:15 PDT, Benoit Jacob [:bjacob] (mostly away)
jgilbert: review+
Details | Diff | Review

Description Benoit Jacob [:bjacob] (mostly away) 2012-07-26 13:13:36 PDT
This is preventing program-test.html from passing on Mac OSX 10.8 with AMD cards. Incidentally it also is what caused us to run into ANGLE bug 351 whem we tried to update ANGLE to r1226 (bug 774755).

The issue is that when a program is currently in-use, attaching bad shaders to it and relinking it should leave its state untouched. This is tested by program-test.html. Many drivers including AMD/MacOSX10.8 fail that and ANGLE r1226 crashed on that (fixed in ANGLE 1242).

The workaround is to check if bad shaders are attached before actually calling glLinkProgram. So, more validation on our side, more shadowing of GL state such as shaders' "compile status" etc.

Note that WebGLShader already had something called its "translation success" but that is a different thing, it's about GLSL ES -> native shader translation.
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2012-07-26 13:15:46 PDT
Created attachment 646286 [details] [diff] [review]
glLinkProgram work-around

Note, doing the work-around unconditionally because it is needed on a wide variety of drivers. I think i've seen this bug in Mesa, etc.
Comment 2 Jeff Gilbert [:jgilbert] 2012-07-26 13:32:38 PDT
Comment on attachment 646286 [details] [diff] [review]
glLinkProgram work-around

Review of attachment 646286 [details] [diff] [review]:
-----------------------------------------------------------------

Gross that we have to do this, but oh well.
Comment 3 Benoit Jacob [:bjacob] (mostly away) 2012-07-26 17:00:24 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/d641b8b46aa0
Comment 4 :Ehsan Akhgari (busy, don't ask for review please) 2012-07-27 08:58:58 PDT
https://hg.mozilla.org/mozilla-central/rev/d641b8b46aa0

Note You need to log in before you can comment on or make changes to this bug.