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;
     }