Advertisement Jump to content
Sign in to follow this  
indigox3

dynamic arrays in HLSL?

This topic is 4474 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

I've seen some cgfx code along the lines of: int var[] ; Is it possible to do something similar in HLSL? I'd like to know if its possible to have dynamically sized arrays for effect parameters. (I'm not sure if the above cgfx code is compatible with the directx profiles)

Share this post


Link to post
Share on other sites
Advertisement
No such concept exists in HLSL. You have to do something like this:


float4 vals[MAX_VALS];
int numVals;


for(i=0;i<numVals;i++)
{
float v=vals;
.
.
}


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!