Sign in to follow this  

Texture/Buffer persistence in VRAM

Recommended Posts

Hi all,

I've written the odd shader but I must admit my overall understanding of the pipeline is lacking. I'm wondering how VRAM memory management works. In particular:

  • Which objects persist in VRAM between frames? I assume textures and vertex info?
  • Can a framebuffer be persisted on the GPU between frames, e.g. if you have a bunch of security cameras in your game that don't need to be updated every frame? Or for temporal reprojection for fancy screen-space effects.
  • What happens if you have too much in VRAM? Does it get paged out, or something worse?

If you can answer any of the above it would be much appreciated.



Share this post

Link to post
Share on other sites


Thanks for the in-depth explanation! It definitely demystifies a lot of things for me.

Do you happen to know whether frame buffers can remain in VRAM between frames? And whether you can copy a buffer to another buffer purely on the GPU? I'm wondering whether a big bank of static security cameras could be rendered on the cheap by keeping pre-rendered low res frame buffers (with depth) and simply drawing dynamic objects on top of them. My guesstimate is that it may work well due to:

  1. Low number of meshes
  2. Low pixel coverage
  3. The majority of pixels failing the Z Test

Share this post

Link to post
Share on other sites

frame buffers will most likely remain in VRAM. You would have to use specific tools/APIs to be sure though. It all depends on the amount of memory you use, you can have 100s of frame buffers in the GPU as long as the memory they occupy isn't needed for other resources/applications. It is good idea to allocate large resources (like framebuffers) as soon as possible to prevent eviction)

Yes, you can 'freely' copy resources (buffers, texture, ..) on the GPU. notice the quotes are all API depened. for example some APIs have the constrain that textures need to have the same dimension and a compatible format while other APIs are pretty mutch memcpy style (very powerful but possible headache introducing :) )

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