diff options
-rw-r--r-- | src/gpu/effects/GrSRGBEffect.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/effects/GrSRGBEffect.cpp b/src/gpu/effects/GrSRGBEffect.cpp index 7e823eaae7..6ca975919d 100644 --- a/src/gpu/effects/GrSRGBEffect.cpp +++ b/src/gpu/effects/GrSRGBEffect.cpp @@ -47,7 +47,9 @@ public: args.fInputColor = "half4(1)"; } - fragBuilder->codeAppendf("half4 color = %s;", args.fInputColor); + // Mali Bifrost uses fp16 for mediump. Making the intermediate color variable highp causes + // calculations to be performed with sufficient precision. + fragBuilder->codeAppendf("float4 color = %s;", args.fInputColor); if (srgbe.alpha() == GrSRGBEffect::Alpha::kPremul) { fragBuilder->codeAppendf("half nonZeroAlpha = max(color.a, 0.00001);"); fragBuilder->codeAppendf("color = half4(color.rgb / nonZeroAlpha, color.a);"); |