Bug 777028 - honor gfx.work-around-driver-bugs for Mesa WebGL workaround - r=jgilbert

This commit is contained in:
Benoit Jacob 2012-08-23 14:56:17 -04:00
parent 9c58fbf74c
commit 63c08f3f80

View File

@ -3722,14 +3722,14 @@ WebGLContext::LinkProgram(WebGLProgram *program, ErrorResult& rv)
// bug 777028
// Mesa can't handle more than 16 samplers per program, counting each array entry.
if (mIsMesa) {
if (program->UpperBoundNumSamplerUniforms() > 16) {
GenerateWarning("Programs with more than 16 samplers are disallowed on Mesa drivers "
"to avoid a Mesa crasher.");
if (gl->WorkAroundDriverBugs() &&
mIsMesa &&
program->UpperBoundNumSamplerUniforms() > 16)
{
GenerateWarning("Programs with more than 16 samplers are disallowed on Mesa drivers " "to avoid a Mesa crasher.");
program->SetLinkStatus(false);
return;
}
}
GLint ok;
if (gl->WorkAroundDriverBugs() &&