Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit f0b6044

Browse files
lhkbobSkia Commit-Bot
authored andcommitted
Revert "Fix performance regresion on Mali, while preserving sk_FragCoord.w"
This reverts commit a34e6ea. 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>
1 parent 315805e commit f0b6044

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/sksl/SkSLGLSLCodeGenerator.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,9 @@ void GLSLCodeGenerator::writeFragCoord() {
756756
this->write("gl_FragCoord");
757757
} else {
758758
if (!fSetupFragPositionLocal) {
759-
// Accessing the components of gl_FragCoord cause pretty noticeable performance hits on
760-
// the Mali400. Reading from the z component of gl_FragCoord or _sktmpCoord, flipping
761-
// the y value after assigning to sk_FragCoord, or not using a temp variable are not as
762-
// optimal.
763759
fFunctionHeader += usesPrecisionModifiers() ? "highp " : "";
764-
fFunctionHeader += " vec4 _sktmpCoord = gl_FragCoord;\n";
765-
fFunctionHeader += usesPrecisionModifiers() ? "highp " : "";
766-
fFunctionHeader += " vec4 sk_FragCoord = vec4(_sktmpCoord.x, " SKSL_RTHEIGHT_NAME
767-
" - _sktmpCoord.y, 0.0, _sktmpCoord.w);\n";
760+
fFunctionHeader += " vec4 sk_FragCoord = vec4(gl_FragCoord.x, " SKSL_RTHEIGHT_NAME
761+
" - gl_FragCoord.y, gl_FragCoord.z, gl_FragCoord.w);\n";
768762
fSetupFragPositionLocal = true;
769763
}
770764
this->write("sk_FragCoord");

tests/SkSLGLSLTest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,9 +1147,8 @@ DEF_TEST(SkSLFragCoord, r) {
11471147
"uniform float u_skRTHeight;\n"
11481148
"out vec4 sk_FragColor;\n"
11491149
"void main() {\n"
1150-
" vec4 _sktmpCoord = gl_FragCoord;\n"
1151-
" vec4 sk_FragCoord = vec4(_sktmpCoord.x, u_skRTHeight - _sktmpCoord.y, "
1152-
"0.0, _sktmpCoord.w);\n"
1150+
" vec4 sk_FragCoord = vec4(gl_FragCoord.x, u_skRTHeight - gl_FragCoord.y, "
1151+
"gl_FragCoord.z, gl_FragCoord.w);\n"
11531152
" sk_FragColor.xy = sk_FragCoord.xy;\n"
11541153
"}\n",
11551154
&inputs);

0 commit comments

Comments
 (0)