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;
|
|
|
|
}
|
|
|
|
|
2021-11-11 19:00:34 +00:00
|
|
|
inline void outParameterWriteIndirect(out half4 c) {
|
|
|
|
outParameterWrite(c);
|
|
|
|
}
|
|
|
|
|
2021-11-11 13:56:16 +00:00
|
|
|
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 19:00:34 +00:00
|
|
|
inline void inoutParameterWriteIndirect(inout half4 x) {
|
|
|
|
inoutParameterWrite(x);
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-04-21 18:27:08 +00:00
|
|
|
half4 main(float2 coords) {
|
2021-11-11 13:56:16 +00:00
|
|
|
half4 c;
|
|
|
|
|
2022-01-25 20:54:24 +00:00
|
|
|
// These functions write to their `out` param.
|
2021-11-11 13:56:16 +00:00
|
|
|
outParameterWrite(c);
|
2021-11-11 19:00:34 +00:00
|
|
|
outParameterWriteIndirect(c);
|
2021-11-11 13:56:16 +00:00
|
|
|
inoutParameterWrite(c);
|
2021-11-11 19:00:34 +00:00
|
|
|
inoutParameterWriteIndirect(c);
|
2021-11-11 13:56:16 +00:00
|
|
|
|
2022-01-25 20:54:24 +00:00
|
|
|
// These functions don't write to their `out` param.
|
2021-11-11 13:56:16 +00:00
|
|
|
inoutParameterRead(c);
|
|
|
|
inoutParameterIgnore(c);
|
|
|
|
|
2021-03-25 21:04:36 +00:00
|
|
|
return c;
|
2020-09-15 14:10:43 +00:00
|
|
|
}
|