Results 1 to 4 of 4

Thread: Does Vulkan prevent the local device memory fragmentation?

  1. #1

    Does Vulkan prevent the local device memory fragmentation?

    I hope it is not already asked, but as the question says, after a series of allocations and releases, the device memory may become fragmented and, despite having enough memory for a request, the runtime won't provide a valid pointer because that memory isn't contiguous. Does Vulkan prevent this in any form? or should we write our own managers to address such issue?

    Thanks

  2. #2
    Quote Originally Posted by SantiagoAlberto View Post
    I hope it is not already asked, but as the question says, after a series of allocations and releases, the device memory may become fragmented and, despite having enough memory for a request, the runtime won't provide a valid pointer because that memory isn't contiguous. Does Vulkan prevent this in any form? or should we write our own managers to address such issue?

    Thanks
    You should not be allocating and releasing memory in Vulkan sufficiently frequently for that to matter. Most applications that need to use Vulkan should make a fixed number of allocations.

  3. #3
    Senior Member
    Join Date
    Dec 2013
    Location
    Germany
    Posts
    147
    Yes, that's the correct way. You should keep API allocations down to a minimum and allocate in big chunks per memory type instead (e.g. 256 MB) and do sub-allocations yourself and then just offset for rendering.

    If you need a basic example (without manual sub allocations) of how to do this, there is an https://github.com/SaschaWillems/Vulkan/blob/master/scenerendering/scenerendering.cpp]example of this in my repository.

  4. #4
    I will take a look at that example. Thanks for your answers!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean