Sign in to follow this  
gedebook

[hlsl] using Buffer keyword in .fx

Recommended Posts

gedebook    122
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
adt7    751
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
gedebook    122
@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

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