mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
fd4488c3ab
The GPU VA allocator was allocating memory in a way where dereferencing GPU VA required a lock + bsearch() to find the right VA range. Rather than going this route, we turn the common case into O(1) and lock-free by creating a slab allocator which allows us to lookup a pointer directly from a GPU VA with (VA - Base) / PageSize. The number of allocations in the fast path must be limited since we cannot trivially grow the allocator while remaining lock-free for dereferences. Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>