1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
# This tests we inline functions correctly. Chaining the functions helps
# us reach the GLSL IR -> NIR code with some functions intact when the
# conservative optimise flag is set in Mesa. This allows us to test the
# GLSL IR -> NIR conversion code for functions and the NIR function inlining
# code.
[require]
GLSL >= 1.10
[vertex shader]
void main()
{
gl_Position = gl_Vertex;
}
[fragment shader]
void f01(out vec4 f);
void f02(out vec4 f);
void f06(out vec4 f);
void f10(out vec4 f);
void f14(out vec4 f);
void main()
{
vec4 g = vec4(0.0, 0.3, 0.0, 1.0);
f01(g);
gl_FragColor = g;
}
void f01(out vec4 f) {f02(f);}
void f05(out vec4 f) {f06(f);}
void f09(out vec4 f) {f10(f);}
void f13(out vec4 f) {f14(f);}
[fragment shader]
void f03(out vec4 f);
void f07(out vec4 f);
void f11(out vec4 f);
void f15(out vec4 f);
void f02(out vec4 f) {f03(f);}
void f06(out vec4 f) {f07(f);}
void f10(out vec4 f) {f11(f);}
void f14(out vec4 f) {f15(f);}
[fragment shader]
void f04(out vec4 f);
void f08(out vec4 f);
void f12(out vec4 f);
void f16(out float f);
void f03(out vec4 f) {f04(f);}
void f07(out vec4 f) {f08(f);}
void f11(out vec4 f) {f12(f);}
void f15(out vec4 f) {f = vec4(0.0, 0.3, 0.0, 1.0); f16(f.y);}
[fragment shader]
void f05(out vec4 f);
void f09(out vec4 f);
void f13(out vec4 f);
void f04(out vec4 f) {f05(f);}
void f08(out vec4 f) {f09(f);}
void f12(out vec4 f) {f13(f);}
void f16(out float f) {f=0.2;}
[test]
draw rect -1 -1 2 2
probe all rgba 0 0.2 0 1.0
|