Remove unused varying type param from GrGLSLShaderBuilder texture methods.
Change-Id: Icbe887266d201bc6d64555f0e793765bf641e4b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262230
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
diff --git a/src/effects/imagefilters/SkDisplacementMapEffect.cpp b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
index 470a4f3..e647821 100644
--- a/src/effects/imagefilters/SkDisplacementMapEffect.cpp
+++ b/src/effects/imagefilters/SkDisplacementMapEffect.cpp
@@ -584,8 +584,7 @@
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
fragBuilder->codeAppendf("\t\thalf4 %s = ", dColor);
fragBuilder->appendTextureLookup(args.fTexSamplers[0],
- args.fTransformedCoords[0].fVaryingPoint.c_str(),
- args.fTransformedCoords[0].fVaryingPoint.getType());
+ args.fTransformedCoords[0].fVaryingPoint.c_str());
fragBuilder->codeAppend(";\n");
// Unpremultiply the displacement
diff --git a/src/gpu/ccpr/GrCCClipProcessor.cpp b/src/gpu/ccpr/GrCCClipProcessor.cpp
index 5bf6a57..badbaeb 100644
--- a/src/gpu/ccpr/GrCCClipProcessor.cpp
+++ b/src/gpu/ccpr/GrCCClipProcessor.cpp
@@ -73,7 +73,7 @@
atlasTransform, atlasTransform);
f->codeAppend ("coverage = ");
- f->appendTextureLookup(args.fTexSamplers[0], "texcoord", kHalf2_GrSLType);
+ f->appendTextureLookup(args.fTexSamplers[0], "texcoord");
f->codeAppend (".a;");
if (proc.fIsCoverageCount) {
diff --git a/src/gpu/ccpr/GrCCPathProcessor.cpp b/src/gpu/ccpr/GrCCPathProcessor.cpp
index 4c4b300..9d74858 100644
--- a/src/gpu/ccpr/GrCCPathProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPathProcessor.cpp
@@ -231,8 +231,7 @@
// Look up coverage in the atlas.
f->codeAppendf("half coverage = ");
- f->appendTextureLookup(args.fTexSamplers[0], SkStringPrintf("%s.xy", texcoord.fsIn()).c_str(),
- kFloat2_GrSLType);
+ f->appendTextureLookup(args.fTexSamplers[0], SkStringPrintf("%s.xy", texcoord.fsIn()).c_str());
f->codeAppendf(".a;");
if (isCoverageCount) {
diff --git a/src/gpu/effects/GrAtlasedShaderHelpers.h b/src/gpu/effects/GrAtlasedShaderHelpers.h
index 81bc5c5..edf8d9d 100644
--- a/src/gpu/effects/GrAtlasedShaderHelpers.h
+++ b/src/gpu/effects/GrAtlasedShaderHelpers.h
@@ -69,13 +69,11 @@
// conditionally load from the indexed texture sampler
for (int i = 0; i < numTextureSamplers-1; ++i) {
args.fFragBuilder->codeAppendf("if (%s == %d) { %s = ", texIdx.fsIn(), i, colorName);
- args.fFragBuilder->appendTextureLookup(args.fTexSamplers[i], coordName,
- kFloat2_GrSLType);
+ args.fFragBuilder->appendTextureLookup(args.fTexSamplers[i], coordName);
args.fFragBuilder->codeAppend("; } else ");
}
args.fFragBuilder->codeAppendf("{ %s = ", colorName);
- args.fFragBuilder->appendTextureLookup(args.fTexSamplers[numTextureSamplers-1], coordName,
- kFloat2_GrSLType);
+ args.fFragBuilder->appendTextureLookup(args.fTexSamplers[numTextureSamplers - 1], coordName);
args.fFragBuilder->codeAppend("; }");
}
diff --git a/src/gpu/effects/GrShadowGeoProc.cpp b/src/gpu/effects/GrShadowGeoProc.cpp
index c30e6e0..5736288 100644
--- a/src/gpu/effects/GrShadowGeoProc.cpp
+++ b/src/gpu/effects/GrShadowGeoProc.cpp
@@ -46,7 +46,7 @@
fragBuilder->codeAppend("half d = length(shadowParams.xy);");
fragBuilder->codeAppend("float2 uv = float2(shadowParams.z * (1.0 - d), 0.5);");
fragBuilder->codeAppend("half factor = ");
- fragBuilder->appendTextureLookup(args.fTexSamplers[0], "uv", kFloat2_GrSLType);
+ fragBuilder->appendTextureLookup(args.fTexSamplers[0], "uv");
fragBuilder->codeAppend(".a;");
fragBuilder->codeAppendf("%s = half4(factor);", args.fOutputCoverage);
}
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 452768a..827eef7 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -69,8 +69,7 @@
void GrGLSLShaderBuilder::appendTextureLookup(SkString* out,
SamplerHandle samplerHandle,
- const char* coordName,
- GrSLType varyingType) const {
+ const char* coordName) const {
const char* sampler = fProgramBuilder->samplerVariable(samplerHandle);
out->appendf("sample(%s, %s)", sampler, coordName);
append_texture_swizzle(out, fProgramBuilder->samplerSwizzle(samplerHandle));
@@ -78,10 +77,9 @@
void GrGLSLShaderBuilder::appendTextureLookup(SamplerHandle samplerHandle,
const char* coordName,
- GrSLType varyingType,
GrGLSLColorSpaceXformHelper* colorXformHelper) {
SkString lookup;
- this->appendTextureLookup(&lookup, samplerHandle, coordName, varyingType);
+ this->appendTextureLookup(&lookup, samplerHandle, coordName);
this->appendColorGamutXform(lookup.c_str(), colorXformHelper);
}
@@ -90,14 +88,13 @@
SkBlendMode mode,
SamplerHandle samplerHandle,
const char* coordName,
- GrSLType varyingType,
GrGLSLColorSpaceXformHelper* colorXformHelper) {
if (!dst) {
dst = "half4(1)";
}
SkString lookup;
this->codeAppendf("%s(", GrGLSLBlend::BlendFuncName(mode));
- this->appendTextureLookup(&lookup, samplerHandle, coordName, varyingType);
+ this->appendTextureLookup(&lookup, samplerHandle, coordName);
this->appendColorGamutXform(lookup.c_str(), colorXformHelper);
this->codeAppendf(", %s)", dst);
}
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h
index 937a871..ee0a494 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.h
@@ -28,20 +28,15 @@
using SamplerHandle = GrGLSLUniformHandler::SamplerHandle;
- /** Appends a 2D texture sample with projection if necessary. coordType must either be Vec2f or
- Vec3f. The latter is interpreted as projective texture coords. The vec length and swizzle
+ /** Appends a 2D texture sample with projection if necessary. The vec length and swizzle
order of the result depends on the GrProcessor::TextureSampler associated with the
SamplerHandle.
*/
- void appendTextureLookup(SkString* out,
- SamplerHandle,
- const char* coordName,
- GrSLType coordType = kHalf2_GrSLType) const;
+ void appendTextureLookup(SkString* out, SamplerHandle, const char* coordName) const;
/** Version of above that appends the result to the shader code instead.*/
void appendTextureLookup(SamplerHandle,
const char* coordName,
- GrSLType coordType = kHalf2_GrSLType,
GrGLSLColorSpaceXformHelper* colorXformHelper = nullptr);
/** Does the work of appendTextureLookup and blends the result by dst, treating the texture
@@ -51,7 +46,6 @@
SkBlendMode,
SamplerHandle,
const char* coordName,
- GrSLType coordType = kHalf2_GrSLType,
GrGLSLColorSpaceXformHelper* colorXformHelper = nullptr);
/** Adds a helper function to facilitate color gamut transformation, and produces code that
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp
index 2535a4b..6778d32 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp
@@ -77,8 +77,7 @@
}
fragBuilder->codeAppendf("half4 %s = ", dstColor);
- fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord",
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord");
fragBuilder->codeAppend(";");
} else {
needsLocalOutColor = args.fShaderCaps->requiresLocalOutputColorForFBFetch();
diff --git a/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index f207516..7bad753 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -82,7 +82,6 @@
SkBlendMode::kModulate,
args.fTexSamplers[0],
"clamp(textureCoords, textureDomain.xy, textureDomain.zw)",
- kFloat2_GrSLType,
&fColorSpaceXformHelper);
args.fFragBuilder->codeAppend(";");
args.fFragBuilder->codeAppendf("%s = half4(1);", args.fOutputCoverage);
diff --git a/src/gpu/ops/GrQuadPerEdgeAA.cpp b/src/gpu/ops/GrQuadPerEdgeAA.cpp
index 65d230c..63afa8f 100644
--- a/src/gpu/ops/GrQuadPerEdgeAA.cpp
+++ b/src/gpu/ops/GrQuadPerEdgeAA.cpp
@@ -666,7 +666,7 @@
args.fFragBuilder->codeAppendf("%s = ", args.fOutputColor);
args.fFragBuilder->appendTextureLookupAndBlend(
args.fOutputColor, SkBlendMode::kModulate, args.fTexSamplers[0],
- "texCoord", kFloat2_GrSLType, &fTextureColorSpaceXformHelper);
+ "texCoord", &fTextureColorSpaceXformHelper);
args.fFragBuilder->codeAppend(";");
if (gp.fSaturate == Saturate::kYes) {
args.fFragBuilder->codeAppendf("%s = saturate(%s);",
diff --git a/src/shaders/SkPerlinNoiseShader.cpp b/src/shaders/SkPerlinNoiseShader.cpp
index 307d2d8..8555f37 100644
--- a/src/shaders/SkPerlinNoiseShader.cpp
+++ b/src/shaders/SkPerlinNoiseShader.cpp
@@ -916,8 +916,7 @@
xCoords.appendf("half2(%s.x, 0.5)", floorVal);
noiseCode.appendf("\n\thalf2 %s;\n\t%s.x = ", latticeIdx, latticeIdx);
- fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str(),
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str());
noiseCode.append(".r;");
}
@@ -927,8 +926,7 @@
xCoords.appendf("half2(%s.z, 0.5)", floorVal);
noiseCode.appendf("\n\t%s.y = ", latticeIdx);
- fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str(),
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[0], xCoords.c_str());
noiseCode.append(".r;");
}
@@ -952,8 +950,7 @@
SkString latticeCoords("");
latticeCoords.appendf("half2(%s.x, %s)", bcoords, chanCoord);
noiseCode.appendf("\n\thalf4 %s = ", lattice);
- fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str());
noiseCode.appendf(".bgra;\n\t%s.x = ", uv);
noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
}
@@ -964,8 +961,7 @@
SkString latticeCoords("");
latticeCoords.appendf("half2(%s.y, %s)", bcoords, chanCoord);
noiseCode.append("\n\tlattice = ");
- fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str());
noiseCode.appendf(".bgra;\n\t%s.y = ", uv);
noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
}
@@ -980,8 +976,7 @@
SkString latticeCoords("");
latticeCoords.appendf("half2(%s.w, %s)", bcoords, chanCoord);
noiseCode.append("\n\tlattice = ");
- fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str());
noiseCode.appendf(".bgra;\n\t%s.y = ", uv);
noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
}
@@ -992,8 +987,7 @@
SkString latticeCoords("");
latticeCoords.appendf("half2(%s.z, %s)", bcoords, chanCoord);
noiseCode.append("\n\tlattice = ");
- fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str(),
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&noiseCode, args.fTexSamplers[1], latticeCoords.c_str());
noiseCode.appendf(".bgra;\n\t%s.x = ", uv);
noiseCode.appendf(dotLattice, lattice, lattice, inc8bit, fractVal);
}
@@ -1280,8 +1274,8 @@
SkString permCode("return ");
// FIXME even though I'm creating these textures with kRepeat_TileMode, they're clamped. Not
// sure why. Using fract() (here and the next texture lookup) as a workaround.
- fragBuilder->appendTextureLookup(&permCode, args.fTexSamplers[0], "float2(fract(x / 256.0), 0.0)",
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&permCode, args.fTexSamplers[0],
+ "float2(fract(x / 256.0), 0.0)");
permCode.append(".r * 255.0;");
fragBuilder->emitFunction(kHalf_GrSLType, "perm", SK_ARRAY_COUNT(permArgs), permArgs,
permCode.c_str(), &permFuncName);
@@ -1293,8 +1287,8 @@
};
SkString gradFuncName;
SkString gradCode("return half(dot(");
- fragBuilder->appendTextureLookup(&gradCode, args.fTexSamplers[1], "float2(fract(x / 16.0), 0.0)",
- kHalf2_GrSLType);
+ fragBuilder->appendTextureLookup(&gradCode, args.fTexSamplers[1],
+ "float2(fract(x / 16.0), 0.0)");
gradCode.append(".rgb * 255.0 - float3(1.0), p));");
fragBuilder->emitFunction(kHalf_GrSLType, "grad", SK_ARRAY_COUNT(gradArgs), gradArgs,
gradCode.c_str(), &gradFuncName);