diff options
author | 2017-08-16 16:41:30 -0400 | |
---|---|---|
committer | 2017-08-16 23:05:15 +0000 | |
commit | 88d99c63878c2d3d340120f0321676f72afcb4f0 (patch) | |
tree | 5b957dbf2f78ef7a15aa3810f8922c915508683f /src/gpu/effects/GrConfigConversionEffect.cpp | |
parent | a26d219a929f4e70f8597dfd57a53348c4bba905 (diff) |
Switched highp float to highfloat and mediump float to half.
The ultimate goal is to end up with "float" and "half", but this
intermediate step uses "highfloat" so that it is clear if I missed a
"float" somewhere. Once this lands, a subsequent CL will switch all
"highfloats" back to "floats".
Bug: skia:
Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca
Reviewed-on: https://skia-review.googlesource.com/31000
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrConfigConversionEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index 2cf7919543..668423d8d2 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -20,17 +20,14 @@ public: const GrConfigConversionEffect& cce = args.fFp.cast<GrConfigConversionEffect>(); GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; - // Use highp throughout the shader to avoid some precision issues on specific GPUs. - fragBuilder->elevateDefaultPrecision(kHigh_GrSLPrecision); - if (nullptr == args.fInputColor) { // could optimize this case, but we aren't for now. - args.fInputColor = "float4(1)"; + args.fInputColor = "half4(1)"; } // Aggressively round to the nearest exact (N / 255) floating point value. This lets us // find a round-trip preserving pair on some GPUs that do odd byte to float conversion. - fragBuilder->codeAppendf("float4 color = floor(%s * 255.0 + 0.5) / 255.0;", args.fInputColor); + fragBuilder->codeAppendf("half4 color = floor(%s * 255.0 + 0.5) / 255.0;", args.fInputColor); switch (cce.pmConversion()) { case GrConfigConversionEffect::kToPremul_PMConversion: @@ -40,7 +37,7 @@ public: case GrConfigConversionEffect::kToUnpremul_PMConversion: fragBuilder->codeAppend( - "color.rgb = color.a <= 0.0 ? float3(0,0,0) : floor(color.rgb / color.a * 255.0 + 0.5) / 255.0;"); + "color.rgb = color.a <= 0.0 ? half3(0,0,0) : floor(color.rgb / color.a * 255.0 + 0.5) / 255.0;"); break; default: |