Input:
uniform int A;
uniform int B;
out vec4 O;
void main() {
O = vec4(0);
float f = 1;
if (B < 2) f = A;
{
float n = A + 1;
if (B < 1) O.y=1;
float f = f * n + n * n;
O.x=f;
}
}
With no options, correct output:
uniform int v,Q;
out vec4 i;
void main()
{
i=vec4(0);
float m=1;
if(Q<2)
m=v;
{
float f=v+1;
if(Q<1)
i.y=1;
f=m*f+f*f;
i.x=f;
}
}
With --move-declarations:
uniform int v,Q;
out vec4 i;
void main()
{
i=vec4(0);
float m=1;
if(Q<2)
m=v;
{
float x=v+1,f;
if(Q<1)
i.y=1;
f=f*x+x*x; // here
i.x=f;
}
}
Now f=f*x+x*x is referencing the uninitialized variable f instead of resolving correctly to m.
Some cases of scope shadowing with visibility to context scope in the initializer expression were already resolved in #153.
Input:
With no options, correct output:
With
--move-declarations:Now
f=f*x+x*xis referencing the uninitialized variablefinstead of resolving correctly tom.Some cases of scope shadowing with visibility to context scope in the initializer expression were already resolved in #153.