Commit 2cf959c8 authored by Timothy Arceri's avatar Timothy Arceri

glsl-1.10: add a number of new function parameter tests

These all have long function call chains, so that some remain intact
when Mesas GLSLOptimizeConservatively flag is set. This allows us
to exercise the GLSL IR -> NIR path for functions and NIRs function
inlining code.
parent aacc0e59
# 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]
float f01(in float f[4]);
float f02(in float f[4]);
float f06(in float f[4]);
float f10(in float f[4]);
float f14(in float f[4]);
void main()
{
float g[4];
g[0] = 0.0;
g[1] = 1.0;
g[2] = 0.0;
g[3] = 0.1;
f01(g);
gl_FragColor = vec4(f01(g), g[0], g[2], g[1]);
}
float f01(in float f[4]) {return f02(f);}
float f05(in float f[4]) {return f06(f);}
float f09(in float f[4]) {return f10(f);}
float f13(in float f[4]) {return f14(f);}
[fragment shader]
float f03(in float f[4]);
float f07(in float f[4]);
float f11(in float f[4]);
float f15(in float f[4]);
float f02(in float f[4]) {return f03(f);}
float f06(in float f[4]) {return f07(f);}
float f10(in float f[4]) {return f11(f);}
float f14(in float f[4]) {return f15(f);}
[fragment shader]
float f04(in float f[4]);
float f08(in float f[4]);
float f12(in float f[4]);
float f16(in float f[4]);
float f03(in float f[4]) {return f04(f);}
float f07(in float f[4]) {return f08(f);}
float f11(in float f[4]) {return f12(f);}
float f15(in float f[4]) {return f16(f);}
[fragment shader]
uniform int i;
float f05(in float f[4]);
float f09(in float f[4]);
float f13(in float f[4]);
float f04(in float f[4]) {return f05(f);}
float f08(in float f[4]) {return f09(f);}
float f12(in float f[4]) {return f13(f);}
float f16(in float f[4]) {return f[i] + 0.1;}
[test]
uniform int i 3
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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]
float f01(in float f[4]);
float f02(in float f[4]);
float f06(in float f[4]);
float f10(in float f[4]);
float f14(in float f[4]);
void main()
{
float g[4];
g[0] = 0.0;
g[1] = 1.0;
g[2] = 0.0;
g[3] = 0.1;
f01(g);
gl_FragColor = vec4(f01(g), g[0], g[2], g[1]);
}
float f01(in float f[4]) {return f02(f);}
float f05(in float f[4]) {return f06(f);}
float f09(in float f[4]) {return f10(f);}
float f13(in float f[4]) {return f14(f);}
[fragment shader]
float f03(in float f[4]);
float f07(in float f[4]);
float f11(in float f[4]);
float f15(in float f[4]);
float f02(in float f[4]) {return f03(f);}
float f06(in float f[4]) {return f07(f);}
float f10(in float f[4]) {return f11(f);}
float f14(in float f[4]) {return f15(f);}
[fragment shader]
uniform int i;
float f04(in float f[4]);
float f08(in float f[4]);
float f12(in float f[4]);
float f16(in float f);
float f03(in float f[4]) {return f04(f);}
float f07(in float f[4]) {return f08(f);}
float f11(in float f[4]) {return f12(f);}
float f15(in float f[4]) {return f16(f[i]);}
[fragment shader]
float f05(in float f[4]);
float f09(in float f[4]);
float f13(in float f[4]);
float f04(in float f[4]) {return f05(f);}
float f08(in float f[4]) {return f09(f);}
float f12(in float f[4]) {return f13(f);}
float f16(in float f) {return f + 0.1;}
[test]
uniform int i 3
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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]
float f01(in float f[4]);
float f02(in float f[4]);
float f06(in float f[4]);
float f10(in float f[4]);
float f14(in float f[4]);
void main()
{
float g[4];
g[0] = 0.0;
g[1] = 1.0;
g[2] = 0.0;
g[3] = 0.1;
f01(g);
gl_FragColor = vec4(f01(g), g[0], g[2], g[1]);
}
float f01(in float f[4]) {return f02(f);}
float f05(in float f[4]) {return f06(f);}
float f09(in float f[4]) {return f10(f);}
float f13(in float f[4]) {return f14(f);}
[fragment shader]
float f03(in float f[4]);
float f07(in float f[4]);
float f11(in float f[4]);
float f15(in float f[4]);
float f02(in float f[4]) {return f03(f);}
float f06(in float f[4]) {return f07(f);}
float f10(in float f[4]) {return f11(f);}
float f14(in float f[4]) {return f15(f);}
[fragment shader]
float f04(in float f[4]);
float f08(in float f[4]);
float f12(in float f[4]);
float f16(in float f[4]);
float f03(in float f[4]) {return f04(f);}
float f07(in float f[4]) {return f08(f);}
float f11(in float f[4]) {return f12(f);}
float f15(in float f[4]) {return f16(f);}
[fragment shader]
float f05(in float f[4]);
float f09(in float f[4]);
float f13(in float f[4]);
float f04(in float f[4]) {return f05(f);}
float f08(in float f[4]) {return f09(f);}
float f12(in float f[4]) {return f13(f);}
float f16(in float f[4]) {return f[3] + 0.1;}
[test]
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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]
float f01(in float f[4]);
float f02(in float f[4]);
float f06(in float f[4]);
float f10(in float f[4]);
float f14(in float f[4]);
void main()
{
float g[4];
g[0] = 0.0;
g[1] = 1.0;
g[2] = 0.0;
g[3] = 0.1;
f01(g);
gl_FragColor = vec4(f01(g), g[0], g[2], g[1]);
}
float f01(in float f[4]) {return f02(f);}
float f05(in float f[4]) {return f06(f);}
float f09(in float f[4]) {return f10(f);}
float f13(in float f[4]) {return f14(f);}
[fragment shader]
float f03(in float f[4]);
float f07(in float f[4]);
float f11(in float f[4]);
float f15(in float f[4]);
float f02(in float f[4]) {return f03(f);}
float f06(in float f[4]) {return f07(f);}
float f10(in float f[4]) {return f11(f);}
float f14(in float f[4]) {return f15(f);}
[fragment shader]
float f04(in float f[4]);
float f08(in float f[4]);
float f12(in float f[4]);
float f16(in float f);
float f03(in float f[4]) {return f04(f);}
float f07(in float f[4]) {return f08(f);}
float f11(in float f[4]) {return f12(f);}
float f15(in float f[4]) {return f16(f[3]);}
[fragment shader]
float f05(in float f[4]);
float f09(in float f[4]);
float f13(in float f[4]);
float f04(in float f[4]) {return f05(f);}
float f08(in float f[4]) {return f09(f);}
float f12(in float f[4]) {return f13(f);}
float f16(in float f) {return f + 0.1;}
[test]
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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]
float f01(in vec4 f);
float f02(in vec4 f);
float f06(in vec4 f);
float f10(in vec4 f);
float f14(in vec4 f);
void main()
{
vec4 g = vec4(0, 0.1, 0, 1.0);
f01(g);
gl_FragColor = vec4(f01(g), g.x, g.z, g.w);
}
float f01(in vec4 f) {return f02(f);}
float f05(in vec4 f) {return f06(f);}
float f09(in vec4 f) {return f10(f);}
float f13(in vec4 f) {return f14(f);}
[fragment shader]
float f03(in vec4 f);
float f07(in vec4 f);
float f11(in vec4 f);
float f15(in vec4 f);
float f02(in vec4 f) {return f03(f);}
float f06(in vec4 f) {return f07(f);}
float f10(in vec4 f) {return f11(f);}
float f14(in vec4 f) {return f15(f);}
[fragment shader]
float f04(in vec4 f);
float f08(in vec4 f);
float f12(in vec4 f);
float f16(in float f);
float f03(in vec4 f) {return f04(f);}
float f07(in vec4 f) {return f08(f);}
float f11(in vec4 f) {return f12(f);}
float f15(in vec4 f) {return f16(f.y);}
[fragment shader]
float f05(in vec4 f);
float f09(in vec4 f);
float f13(in vec4 f);
float f04(in vec4 f) {return f05(f);}
float f08(in vec4 f) {return f09(f);}
float f12(in vec4 f) {return f13(f);}
float f16(in float f) {return f + 0.1;}
[test]
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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]
float f01(in vec4 f);
float f02(in vec4 f);
float f06(in vec4 f);
float f10(in vec4 f);
float f14(in vec4 f);
void main()
{
vec4 g = vec4(0, 0.1, 0, 1.0);
f01(g);
gl_FragColor = vec4(f01(g), g.x, g.z, g.w);
}
float f01(in vec4 f) {return f02(f);}
float f05(in vec4 f) {return f06(f);}
float f09(in vec4 f) {return f10(f);}
float f13(in vec4 f) {return f14(f);}
[fragment shader]
float f03(in vec4 f);
float f07(in vec4 f);
float f11(in vec4 f);
float f15(in vec4 f);
float f02(in vec4 f) {return f03(f);}
float f06(in vec4 f) {return f07(f);}
float f10(in vec4 f) {return f11(f);}
float f14(in vec4 f) {return f15(f);}
[fragment shader]
float f04(in vec4 f);
float f08(in vec4 f);
float f12(in vec4 f);
float f16(in vec4 f);
float f03(in vec4 f) {return f04(f);}
float f07(in vec4 f) {return f08(f);}
float f11(in vec4 f) {return f12(f);}
float f15(in vec4 f) {return f16(f);}
[fragment shader]
float f05(in vec4 f);
float f09(in vec4 f);
float f13(in vec4 f);
float f04(in vec4 f) {return f05(f);}
float f08(in vec4 f) {return f09(f);}
float f12(in vec4 f) {return f13(f);}
float f16(in vec4 f) {return f.y + 0.1;}
[test]
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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(inout vec4 f);
void f02(inout vec4 f);
void f06(inout vec4 f);
void f10(inout vec4 f);
void f14(inout vec4 f);
void main()
{
vec4 g = vec4(0.1, 0, 0, 1.0);
f01(g);
gl_FragColor = g;
}
void f01(inout vec4 f) {f02(f);}
void f05(inout vec4 f) {f06(f);}
void f09(inout vec4 f) {f10(f);}
void f13(inout vec4 f) {f14(f);}
[fragment shader]
void f03(inout vec4 f);
void f07(inout vec4 f);
void f11(inout vec4 f);
void f15(inout vec4 f);
void f02(inout vec4 f) {f03(f);}
void f06(inout vec4 f) {f07(f);}
void f10(inout vec4 f) {f11(f);}
void f14(inout vec4 f) {f15(f);}
[fragment shader]
void f04(inout vec4 f);
void f08(inout vec4 f);
void f12(inout vec4 f);
void f16(inout float f);
void f03(inout vec4 f) {f04(f);}
void f07(inout vec4 f) {f08(f);}
void f11(inout vec4 f) {f12(f);}
void f15(inout vec4 f) {f16(f.x);}
[fragment shader]
void f05(inout vec4 f);
void f09(inout vec4 f);
void f13(inout vec4 f);
void f04(inout vec4 f) {f05(f);}
void f08(inout vec4 f) {f09(f);}
void f12(inout vec4 f) {f13(f);}
void f16(inout float f) {f+=0.1;}
[test]
draw rect -1 -1 2 2
probe all rgba 0.2 0 0 1.0
# 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(inout vec4 f);
void f02(inout vec4 f);
void f06(inout vec4 f);
void f10(inout vec4 f);
void f14(inout vec4 f);
void main()
{
vec4 g = vec4(0.0, 0.3, 0, 1.0);
f01(g);
gl_FragColor = g;
}
void f01(inout vec4 f) {f02(f);}
void f05(inout vec4 f) {f06(f);}
void f09(inout vec4 f) {f10(f);}
void f13(inout vec4 f) {f14(f);}
[fragment shader]
void f03(inout vec4 f);
void f07(inout vec4 f);
void f11(inout vec4 f);
void f15(inout vec4 f);
void f02(inout vec4 f) {f03(f);}
void f06(inout vec4 f) {f07(f);}
void f10(inout vec4 f) {f11(f);}
void f14(inout vec4 f) {f15(f);}
[fragment shader]
void f04(inout vec4 f);
void f08(inout vec4 f);
void f12(inout vec4 f);
void f16(inout float f);
void f03(inout vec4 f) {f04(f);}
void f07(inout vec4 f) {f08(f);}
void f11(inout vec4 f) {f12(f);}
void f15(inout vec4 f) {f16(f.y);}
[fragment shader]
void f05(inout vec4 f);
void f09(inout vec4 f);
void f13(inout vec4 f);
void f04(inout vec4 f) {f05(f);}
void f08(inout vec4 f) {f09(f);}
void f12(inout vec4 f) {f13(f);}
void f16(inout float f) {f=0.2;}
[test]
draw rect -1 -1 2 2
probe all rgba 0 0.2 0 1.0
# 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(inout float f);
void f02(inout float f);
void f06(inout float f);
void f10(inout float f);
void f14(inout float f);
void main()
{
float g = 0.3;
f01(g);
gl_FragColor = vec4(0.0, g, 0, 1.0);
}
void f01(inout float f) {f02(f);}
void f05(inout float f) {f06(f);}
void f09(inout float f) {f10(f);}
void f13(inout float f) {f14(f);}
[fragment shader]
void f03(inout float f);
void f07(inout float f);
void f11(inout float f);
void f15(inout float f);
void f02(inout float f) {f03(f);}
void f06(inout float f) {f07(f);}
void f10(inout float f) {f11(f);}
void f14(inout float f) {f15(f);}
[fragment shader]
void f04(inout float f);
void f08(inout float f);
void f12(inout float f);
void f16(inout float f);
void f03(inout float f) {f04(f);}
void f07(inout float f) {f08(f);}
void f11(inout float f) {f12(f);}
void f15(inout float f) {f16(f);}
[fragment shader]
void f05(inout float f);
void f09(inout float f);
void f13(inout float f);
void f04(inout float f) {f05(f);}
void f08(inout float f) {f09(f);}
void f12(inout float f) {f13(f);}
void f16(inout float f) {f=0.2;}
[test]
draw rect -1 -1 2 2
probe all rgba 0 0.2 0 1.0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment