• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1void inc1(out float x)  { x++; }
2void inc4(out float4 x) { x += half4(1); }
3
4void test_a() { inc1(0); }
5void test_b() { inc4(float4(0)); }
6void test_c() { inc1(sqrt(1)); }
7
8// $pure isn't allowed outside of module code, but the test still does its job; it just reports an
9// additional error as well ('$pure' is not permitted here).
10$pure void pure_function_with_out_param  (out float x)   { x = 1; }
11$pure void pure_function_with_inout_param(inout float x) { x += 1; }
12
13/*%%*
14cannot assign to this expression
15cannot assign to this expression
16cannot assign to this expression
17pure functions cannot have out parameters
18pure functions cannot have out parameters
19*%%*/
20