Revert "Fix performance regresion on Mali, while preserving sk_FragCoord.w"
This reverts commit a34e6eac3c6a765a28abc15e132534652a6295d2.
Reason for revert: Broken gold images on Adreno 530 and 540
Original change's description:
> Fix performance regresion on Mali, while preserving sk_FragCoord.w
>
> Bug: skia:
> Change-Id: I9269288bbb861cd02efa7b5dfe2c9434ec39064e
> Reviewed-on: https://skia-review.googlesource.com/c/174309
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,michaelludwig@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Id344219c101564a5fd06477895386fad2d8dfa78
Reviewed-on: https://skia-review.googlesource.com/c/175986
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp
index f446204..c231626 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.cpp
+++ b/src/sksl/SkSLGLSLCodeGenerator.cpp
@@ -756,15 +756,9 @@
this->write("gl_FragCoord");
} else {
if (!fSetupFragPositionLocal) {
- // Accessing the components of gl_FragCoord cause pretty noticeable performance hits on
- // the Mali400. Reading from the z component of gl_FragCoord or _sktmpCoord, flipping
- // the y value after assigning to sk_FragCoord, or not using a temp variable are not as
- // optimal.
fFunctionHeader += usesPrecisionModifiers() ? "highp " : "";
- fFunctionHeader += " vec4 _sktmpCoord = gl_FragCoord;\n";
- fFunctionHeader += usesPrecisionModifiers() ? "highp " : "";
- fFunctionHeader += " vec4 sk_FragCoord = vec4(_sktmpCoord.x, " SKSL_RTHEIGHT_NAME
- " - _sktmpCoord.y, 0.0, _sktmpCoord.w);\n";
+ fFunctionHeader += " vec4 sk_FragCoord = vec4(gl_FragCoord.x, " SKSL_RTHEIGHT_NAME
+ " - gl_FragCoord.y, gl_FragCoord.z, gl_FragCoord.w);\n";
fSetupFragPositionLocal = true;
}
this->write("sk_FragCoord");