• 13
• 18
• 19
• 27
• 10

# [hlsl 10] switch error

This topic is 3962 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

internal error: no storage type for switch output code:
			switch(RTid %  4)
{
case 0:
output.col[0] = a;				break;
case 1:
output.col[1] = a;
break;
case 2:
output.col[2] = a;
break;
case 3:
output.col[3] = a;
break;
default:
break;
}

thanks!

##### Share on other sites
output.col[RTid % 4] = a;

Problem solved.

##### Share on other sites
Thanks! but as my former posts reported, it spits below:

warning X3550: array reference cannot be used as an l-value;
not natively addressable, forcing loop to unroll
error X3500: array reference cannot be used as an l-value; no
error X3511: Forced to unroll loop, but unrolling failed.
There was an error compiling expression

I believe many has experienced this??

Quote:
 Original post by Drilianoutput.col[RTid % 4] = a;Problem solved.

##### Share on other sites
Okay, so you can't write to arrays in HLSL unless the index is constant. So you tried a switch, I see.

Try converting it into a set of if/else if/else, see if that solves the issue.

An internal error usually implies a bug in the compiler.

Also, when you ask a question, it's probably best to ASK A QUESTION, instead of just posting a thread with an error and some code. Just something to nicen up the post a bit.