In runtime effects, treat all children as sampled

An unused child that used its coordinates would triggers asserts in the
GP - we expect that all FPs are sampled/invoked. This generates slightly
sub-optimal code (we compute and interpolate the local coordinates for
that child FP), but it's not likely to happen in real code.

Bug: skia:12429
Change-Id: Ic2ddc65d16a7e1f47af8c4192e5ff9ea329bf335
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/446836
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/tests/SkRuntimeEffectTest.cpp b/tests/SkRuntimeEffectTest.cpp
index bf90812..428af17 100644
--- a/tests/SkRuntimeEffectTest.cpp
+++ b/tests/SkRuntimeEffectTest.cpp
@@ -498,6 +498,13 @@
     effect.child("child") = rgbwShader;
     effect.test({0xFF0000FF, 0xFFFF0000, 0xFF00FF00, 0xFFFFFFFF});
 
+    // Bind an image shader, but don't use it - ensure that we don't assert or generate bad shaders.
+    // (skbug.com/12429)
+    effect.build("uniform shader child;"
+                 "half4 main(float2 p) { return half4(0, 1, 0, 1); }");
+    effect.child("child") = rgbwShader;
+    effect.test(0xFF00FF00);
+
     //
     // Helper functions
     //