diff options
author | Jim Van Verth <jvanverth@google.com> | 2017-11-20 12:36:16 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-20 18:07:08 +0000 |
commit | 999ec57291dc7cf1d8e3a745627670e6cadc1c12 (patch) | |
tree | 78b34ac300515da3103c730345d4f0390959fb97 /src/gpu/effects/GrBitmapTextGeoProc.cpp | |
parent | 40dc8a71f5d55dd7ed4e64c883664efae6da70ca (diff) |
Use int when possible to calculate atlas indices in shaders.
On certain iOS devices half has a mantissa of only 10 bits, which is not
enough to perform the floating point trickery to get the lower bits
out of the "texture coordinates". Instead we use int if available, and
float if not available.
Also re-enables multitexturing for iOS and adds a sample which
stresses the issue.
Bug: skia:7285
Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
Reviewed-on: https://skia-review.googlesource.com/71181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/effects/GrBitmapTextGeoProc.cpp')
-rw-r--r-- | src/gpu/effects/GrBitmapTextGeoProc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp index d5f930fec4..4193f1d24c 100644 --- a/src/gpu/effects/GrBitmapTextGeoProc.cpp +++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp @@ -38,7 +38,8 @@ public: &atlasSizeInvName); GrGLSLVertToFrag uv(kFloat2_GrSLType); - GrGLSLVertToFrag texIdx(kHalf_GrSLType); + GrSLType texIdxType = args.fShaderCaps->integerSupport() ? kInt_GrSLType : kFloat_GrSLType; + GrGLSLVertToFrag texIdx(texIdxType); append_index_uv_varyings(args, btgp.inTextureCoords()->fName, atlasSizeInvName, &uv, &texIdx, nullptr); |