2021-03-25 21:04:36 +00:00
|
|
|
uniform half4 colorGreen;
|
|
|
|
|
2021-11-11 13:56:16 +00:00
|
|
|
inline void outParameterWrite(out half4 x) {
|
|
|
|
x = colorGreen;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void inoutParameterWrite(inout half4 x) {
|
2021-03-25 21:04:36 +00:00
|
|
|
x *= x;
|
2020-09-15 14:10:43 +00:00
|
|
|
}
|
|
|
|
|
2021-11-11 13:56:16 +00:00
|
|
|
inline void inoutParameterRead(inout half4 x) {
|
|
|
|
half4 scratch = x * x;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void inoutParameterIgnore(inout half4 x) {
|
|
|
|
half4 scratch = colorGreen * colorGreen;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void outParameterIgnore(out half4 x) {
|
|
|
|
half4 scratch = colorGreen * colorGreen;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We don't inline functions that write to out parameters. (skia:11326)
|
2021-04-21 18:27:08 +00:00
|
|
|
half4 main(float2 coords) {
|
2021-11-11 13:56:16 +00:00
|
|
|
half4 c;
|
|
|
|
|
|
|
|
// These calls are ineligible for inlining, because they write to their `out` param.
|
|
|
|
outParameterWrite(c);
|
|
|
|
inoutParameterWrite(c);
|
|
|
|
|
|
|
|
// TODO(skia:12636): These calls are eligible for inlining, because they don't write to their
|
|
|
|
// `out` param.
|
|
|
|
inoutParameterRead(c);
|
|
|
|
inoutParameterIgnore(c);
|
|
|
|
outParameterIgnore(c);
|
|
|
|
|
2021-03-25 21:04:36 +00:00
|
|
|
return c;
|
2020-09-15 14:10:43 +00:00
|
|
|
}
|