Sign in to follow this  

[hlsl] using Buffer keyword in .fx

This topic is 3097 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 actually would like to implement a dynamic array (not fixed array) in hlsl. But i'm having difficult to do this. Does any one knows how to doing that? I read the dx sdk. Perhaps the datatype Buffer would allow me. But i wonder, how to assign value from cpu into gpu. Please help me. =)

Share this post


Link to post
Share on other sites
Out of interest, why does it need to be a dynamic array?

If you know the maximum size the array could be, you could implement it as a fixed size array of that size, the shader won't care if the values you pass to it don't completely fill the array.

Share this post


Link to post
Share on other sites
@sirob i currently use dx10

@adt7 seem to be odd, my theory about hlsl is less still :(

Now, i currently implement for multiple materials in one 3Dmodel. I wish the gpu would process them all by assigning these multiple materials, like diffuseColor, specularColor, specularPower, and others without accessing per material value by cpu using 'for loop'. It would be slows the cpu performance, doesn't it?

Share this post


Link to post
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this