commit | 46f4497cb684947dce7adfa681b34e50ab3ac5f5 | [log] [tgz] |
---|---|---|
author | John Stiles <johnstiles@google.com> | Tue Mar 02 14:59:41 2021 -0500 |
committer | John Stiles <johnstiles@google.com> | Tue Mar 02 20:52:24 2021 +0000 |
tree | b40ebe743bfbe25c04e5ccff457c6c4891e54617 | |
parent | bc4a36af7c550eb0d081d13799bc737f98d90766 [diff] |
Add const to SkSL layout keys. This will allow @if statements to work properly with layout(key) values even with control-flow analysis disabled. Change-Id: Ib76b8c5553621815decda7fb0eefccb2c82df02b Bug: skia:11319 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/378416 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/effects/generated/GrRectBlurEffect.cpp b/src/gpu/effects/generated/GrRectBlurEffect.cpp index d5d36af..92b86f8 100644 --- a/src/gpu/effects/generated/GrRectBlurEffect.cpp +++ b/src/gpu/effects/generated/GrRectBlurEffect.cpp
@@ -48,7 +48,7 @@ kFloat3x3_GrSLType, "invVM"); } fragBuilder->codeAppendf( - R"SkSL(/* key */ bool highPrecision = %s; + R"SkSL(/* key */ const bool highPrecision = %s; half xCoverage; half yCoverage;
diff --git a/src/sksl/ir/SkSLLayout.h b/src/sksl/ir/SkSLLayout.h index b572ab7..2e3fc5d 100644 --- a/src/sksl/ir/SkSLLayout.h +++ b/src/sksl/ir/SkSLLayout.h
@@ -243,7 +243,7 @@ result = "layout (" + result + ")"; } if (fFlags & kKey_Flag) { - result += "/* key */"; + result += "/* key */ const"; } return result; }