From eadb9f9a559d559b55831d6ba6636d1b4d2d47c7 Mon Sep 17 00:00:00 2001 From: Jim Van Verth Date: Mon, 20 Nov 2017 13:28:48 -0500 Subject: [PATCH] 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 Commit-Queue: Jim Van Verth --- src/gpu/effects/GrAtlasedShaderHelpers.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gpu/effects/GrAtlasedShaderHelpers.h b/src/gpu/effects/GrAtlasedShaderHelpers.h index 7fc321daa2..ae35ec67de 100644 --- a/src/gpu/effects/GrAtlasedShaderHelpers.h +++ b/src/gpu/effects/GrAtlasedShaderHelpers.h @@ -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) {