2 #extension GL_EXT_tessellation_shader : require
3 #extension GL_EXT_gpu_shader5 : require
6 precise float result = 5.0;
11 result = a * b + c * d; // c * d, a * b and rvalue1 + rvalue2 should be 'noContraction'.
15 void continuous_assignment() {
16 precise float result = 5.0;
19 result = a = b + 4; // b + 4 should be 'noContraction'.
23 precise double result;
26 b = a + b; // a + b should be 'noContraction'.
27 result = double(b); // convert operation should not be 'noContraction'.
31 precise float r1 = 5.0;
32 precise float r2 = 10.0;
36 for (int i = 0; i < a; i++) {
37 r1 += 3.12 + b + i; // 'noContration', this make i++ also 'noContraction'
38 c += 1; // 'noContration'
40 a += 1; // a + 1 should not be 'noContraction'.
41 r2 = c; // The calculation of c should be 'noContration'.
42 return float(r1 + r2); // conversion should not be 'noContration'.
45 void loop_array(void) {
52 result += float(x) + float(y); // x + y should be 'noContraction' also result + rvalue.
54 for (int i = 0; i < 3; ++i) {
55 // a's dereference + 2 should be 'noContraction'.
57 // result + 1 and 3 - rvalue should be 'noContraction'.
63 precise float result = 5.0;
67 result += 3.12 + b; // result + 3.12 should be 'noContraction'.
69 result = a + b + 5; // b + 5 should not be 'noCtraction' because all operands are integers.
73 float fma_not_decorated() {
78 b = b + c; // b + c should be decorated with 'noContraction'
79 result = fma(a, b, c); // fma() should not be decorated with 'noContradtion'
83 precise float precise_return_exp_func() {
86 return a + b; // the ADD operation should be 'noContraction'
89 precise float precise_return_val_func() {
92 float result = a + b; // the ADD operation should be 'noContraction'
96 float precise_func_parameter(float b, precise out float c) {
98 c = a + b; // noContration
99 return a - b; // Not noContraction
102 mat3 matrix (mat2x3 a, mat3x2 b) {
103 mat2x3 c = mat2x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
105 result = (a + c) * b; // should be noContraction