Hans-Kristian Arntzen : vkd3d: Optimise the GPU VA allocator.
Alexandre Julliard
julliard at winehq.org
Sun Oct 27 14:21:20 CDT 2019
Module: vkd3d
Branch: master
Commit: fd4488c3ab9ac3ae13bcf778d56b35e804b8d8a0
URL: https://source.winehq.org/git/vkd3d.git/?a=commit;h=fd4488c3ab9ac3ae13bcf778d56b35e804b8d8a0
Author: Hans-Kristian Arntzen <post at arntzen-software.no>
Date: Thu Oct 24 18:21:41 2019 +0330
vkd3d: Optimise the GPU VA allocator.
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 at arntzen-software.no>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
libs/vkd3d/device.c | 226 +++++++++++++++++++++++++++++++++++++--------
libs/vkd3d/vkd3d_private.h | 28 ++++--
2 files changed, 204 insertions(+), 50 deletions(-)
Diff: https://source.winehq.org/git/vkd3d.git/?a=commitdiff;h=fd4488c3ab9ac3ae13bcf778d56b35e804b8d8a0
More information about the wine-cvs
mailing list