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
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)
: Milan Sreckovic [:milan]
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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 User image 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 User image 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 User image Benoit Jacob [:bjacob] (mostly away) 2012-07-26 17:00:24 PDT

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