Jump to content
  • Advertisement
Sign in to follow this  
indigox3

dynamic arrays in HLSL?

This topic is 4238 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!