Jump to content
  • Advertisement
Sign in to follow this  

Staging resources...What "RAM pool"?

This topic is 1325 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

Are staging resources located in CPU RAM?  I have a render target which I like to give the CPU read/write access to, so do I work directly on the staging resource after I copyresource() and map() it or do I copy it to my own CPU allocated memory first?  I also don't need to give the GPU access to the buffer after the CPU is done with it if that matters at all, although reusing the same staging resource might be wise: that is the right thing to do right?

 

Thanks in advance for any help.

Edited by Infinisearch

Share this post


Link to post
Share on other sites
Advertisement

Staging resources are located in the main system memory (ie. the CPU accessible ram) and after you perform copyresource you may map them and then perform CPU reads on it. 

 

The thing to know is that copyresource isn't performed instantly but instead the command is put in the command queue and is performed later. If you call Map right after the CopyResource you'll get a stall because the CPU will wait until the GPU has performed all the operations in command queue (ie. flush). 

 

For example, I copy the GPU z-buffer to a staging resource and in order to avoid a stall I wait 1 frame before calling Map on it.

 

Cheers!

Edited by kauna

Share this post


Link to post
Share on other sites

and after you perform copyresource you may map them and then perform CPU reads on it. 

 

Reads and writes are OK right (not for copying purposes), I think thats what the SDK said; just making sure.

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!