Revert "Add new method for storing DrawOpAtlas texture index."
This reverts commit c8b2e615400fe43b74dbbd2d7167bb97bd032f87.
Reason for revert: Seeing multitexture failures on Gold
Original change's description:
> Add new method for storing DrawOpAtlas texture index.
>
> Storing the texture index in the lower bit of each texture coordinate
> seems to have issues on certain iOS devices. Rather than do that, we
> use the sign of the texture coordinate to act as our storage bit.
> To manage encoding 0 we map [0, N] to [-1, -N-1] to represent a bit.
>
> Change-Id: Ic588ee92cf858915a1833cf482d4b23bd11c1000
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263561
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=jvanverth@google.com,brianosman@google.com
Change-Id: I9ba28eb800e608fb5ee1ce877b5ab8b5b99db261
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264421
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index e6734f0..48b2397 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -37,9 +37,10 @@
kVertex_GrShaderFlag, kFloat2_GrSLType, "AtlasSizeInv", &atlasDimensionsInvName);
GrGLSLVarying uv(kFloat2_GrSLType);
- GrGLSLVarying texIdx(kFloat_GrSLType);
- append_index_uv_varyings(args, btgp.numTextureSamplers(), btgp.inTextureCoords().name(),
- atlasDimensionsInvName, &uv, &texIdx, nullptr);
+ GrSLType texIdxType = args.fShaderCaps->integerSupport() ? kInt_GrSLType : kFloat_GrSLType;
+ GrGLSLVarying texIdx(texIdxType);
+ append_index_uv_varyings(args, btgp.inTextureCoords().name(), atlasDimensionsInvName, &uv,
+ &texIdx, nullptr);
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
// Setup pass through color
@@ -145,8 +146,8 @@
fInColor = MakeColorAttribute("inColor", wideColor);
}
- fInTextureCoords = {"inTextureCoords", kShort2_GrVertexAttribType,
- caps.integerSupport() ? kShort2_GrSLType : kFloat2_GrSLType};
+ fInTextureCoords = {"inTextureCoords", kUShort2_GrVertexAttribType,
+ caps.integerSupport() ? kUShort2_GrSLType : kFloat2_GrSLType};
this->setVertexAttributes(&fInPosition, 3);
if (numActiveViews) {