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>
This commit is contained in:
parent
bc4a36af7c
commit
46f4497cb6
@ -48,7 +48,7 @@ public:
|
||||
kFloat3x3_GrSLType, "invVM");
|
||||
}
|
||||
fragBuilder->codeAppendf(
|
||||
R"SkSL(/* key */ bool highPrecision = %s;
|
||||
R"SkSL(/* key */ const bool highPrecision = %s;
|
||||
half xCoverage;
|
||||
half yCoverage;
|
||||
|
||||
|
@ -243,7 +243,7 @@ struct Layout {
|
||||
result = "layout (" + result + ")";
|
||||
}
|
||||
if (fFlags & kKey_Flag) {
|
||||
result += "/* key */";
|
||||
result += "/* key */ const";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user