Fix bad FP codegen when sample() calls are inlined.
Previously, temp variables created by sample() calls were named after
the offset of the sample() call within the code. This was
straightforward but would fail if the sample() call were duplicated via
inlining of helper functions.
FP sample() temp variables are now named using a counter, starting from
zero and counting upwards.
Change-Id: I16f9a3426117677c0df13d15772320def99cc0d6
Bug: skia:10858
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331415
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/effects/generated/GrConfigConversionEffect.cpp b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
index 57c0220..8c01854 100644
--- a/src/gpu/effects/generated/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/generated/GrConfigConversionEffect.cpp
@@ -28,7 +28,7 @@
(void)pmConversion;
fragBuilder->forceHighPrecision();
- SkString _sample5768 = this->invokeChild(0, args);
+ SkString _sample0 = this->invokeChild(0, args);
fragBuilder->codeAppendf(
R"SkSL(%s = floor(%s * 255.0 + 0.5) / 255.0;
@switch (%d) {
@@ -40,7 +40,7 @@
break;
}
)SkSL",
- args.fOutputColor, _sample5768.c_str(), (int)_outer.pmConversion, args.fOutputColor,
+ args.fOutputColor, _sample0.c_str(), (int)_outer.pmConversion, args.fOutputColor,
args.fOutputColor, args.fOutputColor, args.fOutputColor, args.fOutputColor,
args.fOutputColor, args.fOutputColor);
}