You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I run into trouble with it after using this idiom in my glsls: float a=a;
Reusing the variable in an inner scope so it can be modified and revert to its old value after that scope closes.
We could need to update our scope resolution to allow this.
It's unclear what the behavior in HLSL is (I wouldn't be surprised if it was treated as a circular reference).
The text was updated successfully, but these errors were encountered:
The spec has interesting test cases related to scoping:
intx=1;
{
intx=2, y=x; // y is initialized to 2
}
structS{ intx; };
{
SS=S(0); // 'S' is only visible as a struct and constructorS; // 'S' is now visible as a variable
}
intx=x; // Error if x has not been previously defined.// If the previous definition of x was in this// same scope, this causes a redeclaration error.intf( /* nested scope begins here */intk) {
intk=k+3; // redeclaration error of the name k
}
intf(intk)
{
{
intk=k+3; // 2nd k is parameter, initializing nested first kintm=k; // use of new k, which is hiding the parameter
}
}
ttg reported on Discord:
We could need to update our scope resolution to allow this.
It's unclear what the behavior in HLSL is (I wouldn't be surprised if it was treated as a circular reference).
The text was updated successfully, but these errors were encountered: