Jump to content
  • Advertisement
Sign in to follow this  

Shader techniques, allocated memory

This topic is 3415 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 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!