aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrDistanceFieldGeoProc.cpp
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-11-20 22:11:30 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-20 22:11:39 +0000
commitc02cb8a86ce801f471a8cf7bd46880648c48f089 (patch)
tree2c11e8b9a9e8f53dd0582dcbacf3dd3e34ae5f5c /src/gpu/effects/GrDistanceFieldGeoProc.cpp
parent575e06cd9b9f1e73a319d38f78f4b368df6024a3 (diff)
Revert "Use int when possible to calculate atlas indices in shaders."
This reverts commit 999ec57291dc7cf1d8e3a745627670e6cadc1c12. Reason for revert: Causing issues with NexusPlayer Vulkan. Original change's description: > 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> TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I82801a73a2a8067588049b213f010ff25f4014f3 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7285 Reviewed-on: https://skia-review.googlesource.com/74001 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/gpu/effects/GrDistanceFieldGeoProc.cpp')
-rw-r--r--src/gpu/effects/GrDistanceFieldGeoProc.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 3e9addef6d..aafabdeb60 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -78,8 +78,7 @@ public:
// add varyings
GrGLSLVertToFrag uv(kFloat2_GrSLType);
- GrSLType texIdxType = args.fShaderCaps->integerSupport() ? kInt_GrSLType : kFloat_GrSLType;
- GrGLSLVertToFrag texIdx(texIdxType);
+ GrGLSLVertToFrag texIdx(kHalf_GrSLType);
GrGLSLVertToFrag st(kFloat2_GrSLType);
append_index_uv_varyings(args, dfTexEffect.inTextureCoords()->fName, atlasSizeInvName,
&uv, &texIdx, &st);
@@ -345,8 +344,7 @@ public:
&atlasSizeInvName);
GrGLSLVertToFrag uv(kFloat2_GrSLType);
- GrSLType texIdxType = args.fShaderCaps->integerSupport() ? kInt_GrSLType : kFloat_GrSLType;
- GrGLSLVertToFrag texIdx(texIdxType);
+ GrGLSLVertToFrag texIdx(kHalf_GrSLType);
GrGLSLVertToFrag st(kFloat2_GrSLType);
append_index_uv_varyings(args, dfTexEffect.inTextureCoords()->fName, atlasSizeInvName,
&uv, &texIdx, &st);
@@ -641,8 +639,7 @@ public:
// set up varyings
GrGLSLVertToFrag uv(kFloat2_GrSLType);
- GrSLType texIdxType = args.fShaderCaps->integerSupport() ? kInt_GrSLType : kFloat_GrSLType;
- GrGLSLVertToFrag texIdx(texIdxType);
+ GrGLSLVertToFrag texIdx(kHalf_GrSLType);
GrGLSLVertToFrag st(kFloat2_GrSLType);
append_index_uv_varyings(args, dfTexEffect.inTextureCoords()->fName, atlasSizeInvName,
&uv, &texIdx, &st);