Commit f18b947d authored by Jason Ekstrand's avatar Jason Ekstrand
Browse files

ssa: Add a test for an edge case in into-SSA translation



In particular, we want to test the case

a = ...
if (foo) {
    a = ...
} else {
    break;
}
... = a;

We had a bug in one of the into-ssa passes that caused the use of a at the
end to use the first definition of a instead of the second.
Signed-off-by: Jason Ekstrand's avatarJason Ekstrand <jason.ekstrand@intel.com>
Reviewed-By: Glenn Kennard's avatarGlenn Kennard <glenn.kennard@gmail.com>
parent fd325918
[require]
GLSL >= 1.10
[fragment shader]
uniform bool t, f;
void main()
{
gl_FragColor = vec4(0, 0, 1, 1);
do {
int a = 1;
if (t) {
a = 2;
} else {
break;
}
if (a == 2)
gl_FragColor = vec4(0, 1, 0, 1);
else
gl_FragColor = vec4(1, 0, 0, 1);
} while (f);
}
[test]
uniform int t 1
uniform int f 0
draw rect -1 -1 2 2
probe all rgba 0.0 1.0 0.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