enable OES derivatives extension in shaders that use it

Review URL:  http://codereview.appspot.com/5023043/



git-svn-id: http://skia.googlecode.com/svn/trunk@2269 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-09-14 18:05:30 +00:00
parent 4bce115b31
commit ba72f042f6

View File

@ -556,6 +556,9 @@ bool GrGLProgram::genProgram(const GrGLInterface* gl,
segments.fFSCode.append("\tfloat dfdy = 2.0*vEdge.x*duvdy.x - duvdy.y;\n");
segments.fFSCode.append("\tfloat edgeAlpha = (vEdge.x*vEdge.x - vEdge.y);\n");
segments.fFSCode.append("\tedgeAlpha = sqrt(edgeAlpha*edgeAlpha / (dfdx*dfdx + dfdy*dfdy));\n");
if (gl->supportsES()) {
segments.fHeader.printf("#extension GL_OES_standard_derivatives: enable\n");
}
}
segments.fFSCode.append("\tedgeAlpha = max(1.0 - edgeAlpha, 0.0);\n");
inCoverage = "edgeAlpha";