forcecase would as you said force a switch statement. Something to note is that a switch statement differs from a series of if else conditional statements as it uses a lookup table or hash list, so all "branches" in a switch statement get the same access time, where in a list of if else statements, the further down an if or else is, the longer it will take to reach since it has to execute all previous if else statements
I'm still unclear about call though. In the docs it does say it turns each switch case into a subroutine and the entire switch case is then "a series of subroutine calls". That makes me think that a switch case that looks like this:
[call]switch(i) {
case 0:
break;
case 1:
break;
case 2:
break;
}
would be turned into something like this:
case1(i);
case2(i);
case3(i);
Where does the conditional or switch statement get executed then? i can't imagine it happens inside the subroutine because then your making a lot of unneeded jumps into subroutines. It must happen outside the subroutine to decide which one of many subroutines to jump into. In that case, is it still using a switch statement? or is it using an if else statement?
Since a switch statement is converted to a series of if else statements when no attribute is provided, is it the same for the call attribute? could you have both forcecase and call attributes on a switch statement?
Thinking about it now, it might be that it actually gets called like this:
casei();
I don't now how they would implement that in code exactly, but i suppose all this could be easily cleared up by looking at the assembly of a compiled shader. I would do that right now but i'm at work, so if anybody else wants to do the honors, or if you already know how this works, i for one would appreciate it~