Sign in to follow this  

Shader techniques, allocated memory

Recommended Posts

I use DirectX and HLSL, and I'm a little unsure about how global memory works in the shader. If I upload global data to data1 and use technique1 that references data1, then upload different global data to data2 and use technique2 that references data2, will data1 still be in the shader memory? If I want to use technique1 again after all of this, with the same global data, should I upload the data to data1 again, or can I count on it being the same? From what I understand, shader memory is pretty limited. But global data used by one technique doesn't take up more of the same space as global data used by another technique. Is that right? So while counting available memory for a technique, I only need to look at the single technique in question? If that's true, then the global data from other techniques must be temporarily stored somewhere else, and reinstated when I set the technique again? Is that right? If all of that is true, then it would be wasteful to upload data to the shader again (since the API or GPU is already doing it). If it's not true, then it would be dangerous to avoid uploading the data again, because it might have values written over by another technique. I appreciate any information. If this turns out to be a DirectX-only question, feel free to move this to that forum.

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