Closed Bug 777883 Opened 12 years ago Closed 12 years ago

Avoid calling glLinkProgram when we know that a bad shader is attached

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: bjacob, Assigned: bjacob)

Details

(Whiteboard: webgl-conformance)

Attachments

(1 file)

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.
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.
Attachment #646286 - Flags: review?(jgilbert)
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.
Attachment #646286 - Flags: review?(jgilbert) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/d641b8b46aa0
Assignee: nobody → bjacob
Target Milestone: --- → mozilla17
https://hg.mozilla.org/mozilla-central/rev/d641b8b46aa0
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: