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

@ -3706,7 +3706,7 @@ WebGLContext::LinkProgram(WebGLProgram *program, ErrorResult& rv)
if (!ValidateObject("linkProgram", program))
return;
GLuint progname = program->GLName();
if (!program->NextGeneration()) {
@ -3722,13 +3722,13 @@ 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.");
program->SetLinkStatus(false);
return;
}
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;