Set correct coord transform visibility initially rather than update.
Aside from being simpler it also makes the matrix uniforms for
explicitly sampled FPs appear only in the FS and not both VS and FS.
Change-Id: I0f7a4e83b77decacfd0567600dd2d3bc8ce5240f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278137
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index a83277e..914626e1 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -166,10 +166,7 @@
if (args.fFp.isSampledWithExplicitCoords() && args.fTransformedCoords.count() > 0) {
// we currently only support overriding a single coordinate pair
SkASSERT(args.fTransformedCoords.count() == 1);
- const GrGLSLProgramDataManager::UniformHandle& mat =
- args.fTransformedCoords[0].fUniformMatrix;
- if (mat.isValid()) {
- args.fUniformHandler->updateUniformVisibility(mat, kFragment_GrShaderFlag);
+ if (args.fTransformedCoords[0].fUniformMatrix.isValid()) {
this->codeAppendf("_coords = (%s * float3(_coords, 1)).xy;\n",
args.fTransformedCoords[0].fMatrixCode.c_str());
}