mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
The current buffer allocator allocates a buffer that is either the minimum stage span, the requested size times two, or the largest current allocation times two. Imagine needing a miniscule allocation. We currently have 1M, 8M and 16M buffers, but the 1M buffer is full or not available. The last rule would cause us to request a 32M buffer, rather than a more appropriate 2M buffer to fill the bucket sequence. Make two adjustments to this logic: 1. Round the requested size up to the nearest power of two to avoid odd bucket sizes. 2. Look through the available buffers and find a hole in the bucket sequence to fill, which is made easy by the power of two rule above as we can just iterate until the buffer we are looking at is more than 2x our current target. The buffer we create is inserted into the middle of the list of buffers as needed to maintain the size order. |
||
|---|---|---|
| .. | ||
| shaders | ||
| meson.build | ||
| pass.c | ||
| pixel_format.c | ||
| renderer.c | ||
| texture.c | ||
| util.c | ||
| vulkan.c | ||