Only use flat varyings for integer texIndex.

Flat varyings aren't supported with ES 2.0, so just
fall back to non-flat if we can only handle float.

Change-Id: Id47a773b86666c46916efe5bcb1c629743977ccf
Reviewed-on: https://skia-review.googlesource.com/73800
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
Jim Van Verth 2017-11-20 13:28:48 -05:00 committed by Skia Commit-Bot
parent c60dea17d8
commit eadb9f9a55

View File

@ -40,7 +40,11 @@ static void append_index_uv_varyings(GrGLSLPrimitiveProcessor::EmitArgs& args,
args.fVaryingHandler->addVarying("TextureCoords", uv);
args.fVertBuilder->codeAppendf("%s = intCoords * %s;", uv->vsOut(), atlasSizeInvName);
args.fVaryingHandler->addFlatVarying("TexIndex", texIdx);
if (args.fShaderCaps->integerSupport()) {
args.fVaryingHandler->addFlatVarying("TexIndex", texIdx);
} else {
args.fVaryingHandler->addVarying("TexIndex", texIdx);
}
args.fVertBuilder->codeAppendf("%s = texIdx;", texIdx->vsOut());
if (st) {