-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Firefox potentially creates a lot of devices and we can't know in advance the type and scale of content that the page will want to run. So it is difficult to come up with a good default memory block size that will work well with very complex web apps without making the cost of very simple ones prohibitive. To address that, one way could be to start with small block size and double it every time a new memory block (for a particular memory type) is needed.
Instead of a single device_memblock_size, the allocator's configuration would let the user specify device_minimum_memblock_size and device_maximum_memblock_size, starting allocations with the former and doubling until the latter is reached. Setting both to the same value would preserve the current behavior.
It would also help with switching wgpu's vulkan backend from gpu-alloc to gpu-allocator since gpu-alloc implements the described behavior.
If this is something you would be OK with supporting, I'd like to find some time to implement it at some point in the next few months.