Commit 060d3587 authored by Eric Anholt's avatar Eric Anholt

glsl-1.10: Add tests for a bunch of i965 code generation bugs.

It turns out that everywhere I looked, there were bugs related to
saturate handling with math.
parent 590ab8f6
[vertex shader]
void main()
{
gl_Position = gl_Vertex;
}
[fragment shader]
uniform vec4 v;
void main()
{
gl_FragColor = 0.25 + clamp(exp2(v), 0.0, 1.0) * 0.5;
}
[test]
uniform vec4 v -2 -1 1 2
draw rect -1 -1 2 2
probe all rgba 0.375 0.5 0.75 0.75
[vertex shader]
void main()
{
gl_Position = gl_Vertex;
}
[fragment shader]
uniform vec4 x;
uniform vec4 y;
void main()
{
gl_FragColor = 0.25 + clamp(pow(x, y), 0.0, 1.0) * 0.5;
}
[test]
uniform vec4 x 0.5 2.0 0.5 1.0
uniform vec4 y 2.0 0.5 -1.0 1.0
draw rect -1 -1 2 2
probe all rgba 0.375 0.75 0.75 0.75
[vertex shader]
void main()
{
gl_Position = gl_Vertex;
}
[fragment shader]
uniform vec4 v;
void main()
{
gl_FragColor = 0.25 + clamp(sqrt(v), 0.0, 1.0) * 0.5;
}
[test]
uniform vec4 v 0.25 1.0 2.0 0.25
draw rect -1 -1 2 2
probe all rgba 0.5 0.75 0.75 0.5
[vertex shader]
uniform vec4 v;
varying vec4 color;
void main()
{
gl_Position = gl_Vertex;
color = 0.25 + clamp(exp2(v), 0.0, 1.0) * 0.5;
}
[fragment shader]
varying vec4 color;
void main()
{
gl_FragColor = color;
}
[test]
uniform vec4 v -2 -1 1 2
draw rect -1 -1 2 2
probe all rgba 0.375 0.5 0.75 0.75
[vertex shader]
uniform vec4 x;
uniform vec4 y;
varying vec4 color;
void main()
{
gl_Position = gl_Vertex;
color = 0.25 + clamp(pow(x, y), 0.0, 1.0) * 0.5;
}
[fragment shader]
varying vec4 color;
void main()
{
gl_FragColor = color;
}
[test]
uniform vec4 x 0.5 2.0 0.5 1.0
uniform vec4 y 2.0 0.5 -1.0 1.0
draw rect -1 -1 2 2
probe all rgba 0.375 0.75 0.75 0.75
[vertex shader]
uniform vec4 v;
varying vec4 color;
void main()
{
gl_Position = gl_Vertex;
color = 0.25 + clamp(sqrt(v), 0.0, 1.0) * 0.5;
}
[fragment shader]
varying vec4 color;
void main()
{
gl_FragColor = color;
}
[test]
uniform vec4 v 0.25 1.0 2.0 0.25
draw rect -1 -1 2 2
probe all rgba 0.5 0.75 0.75 0.5
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