aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-03-17 09:36:31 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-17 14:33:04 +0000
commit9bc39bbd1a18d61e4e9c3808c33ea003a8e49938 (patch)
tree6ecc7b0eee4e0292b140062fb1b9bace9928d179 /src/effects
parente88a1cb20e6b4c9f099070112225a88693a4630b (diff)
Add highp to specular lighting intermediate to fix iOS bots
Looks like math was over/under-flowing at default precision, leading to garbage output. This appears to be the minimal change to fix it. BUG=skia: Change-Id: I9381dea380be0d8f5af1e765f4ed1403b0ceac70 Reviewed-on: https://skia-review.googlesource.com/9827 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/effects')
-rw-r--r--src/effects/SkLightingImageFilter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 925a091268..34e7034602 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -2027,7 +2027,8 @@ void GrGLSpecularLightingEffect::emitLightFunc(GrGLSLUniformHandler* uniformHand
};
SkString lightBody;
lightBody.appendf("\tvec3 halfDir = vec3(normalize(surfaceToLight + vec3(0, 0, 1)));\n");
- lightBody.appendf("\tfloat colorScale = %s * pow(dot(normal, halfDir), %s);\n", ks, shininess);
+ lightBody.appendf("\thighp float colorScale = %s * pow(dot(normal, halfDir), %s);\n",
+ ks, shininess);
lightBody.appendf("\tvec3 color = lightColor * clamp(colorScale, 0.0, 1.0);\n");
lightBody.appendf("\treturn vec4(color, max(max(color.r, color.g), color.b));\n");
fragBuilder->emitFunction(kVec4f_GrSLType,