1#version 300 2 3uniform half4 colorGreen; 4uniform half unknownInput; 5uniform half2x2 testMatrix2x2; 6 7half4 func1(half h) { 8 return h.xxxx * h.xxxx; 9} 10 11half4 funcA4(half a[4]) { 12 return half4(a[0], a[1], a[2], 1) * a[3]; 13} 14 15half4 funcA5(half a[5]) { 16 return half4(a[0], a[1], a[2], a[3]) * a[4]; 17} 18 19half4 main(float2 coords) { 20 half4 var; 21 int i = int(unknownInput); 22 23 // These expressions are considered "trivial" and will be cloned directly into the inlined 24 // function without a temporary variable. 25 var = funcA4(half[4](1, 2, 3, 4)); // array with slotCount <= 4 26 27 // These expressions are considered "non-trivial" and will be placed in a temporary variable 28 // when inlining occurs. 29 var = func1(colorGreen[i]); // non-constant indexing 30 var = funcA5(half[5](1, 2, 3, 4, 5)); // array with slotCount > 4 31 i *= int(var.x); 32 33 return colorGreen; 34} 35