Jump to content
  • Advertisement
Sign in to follow this  
yk_cadcg

[hlsl 10] switch error

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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
t natively addressable
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 Drilian

output.col[RTid % 4] = a;

Problem solved.


Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!