[Mesa-dev] [PATCH v2 7/9] anv/allocator: Add a syncobj cache
Chris Wilson
chris at chris-wilson.co.uk
Fri Aug 4 08:59:58 UTC 2017
Quoting Jason Ekstrand (2017-08-04 02:25:26)
> This is mostly a copy+paste of the BO cache but it's a bit simpler
> because syncobjs don't have actual backing storage so we don't need to
> check sizes or anything like that. Also, we put the refcount directly
> in anv_syncobj because they will always be heap pointers.
Ok, but why do we need one at all? Some part of the Vk spec, some bad
behaviour you noticed? Or just that it is more elegant to be minimalist?
> ---
> src/intel/vulkan/anv_allocator.c | 194 +++++++++++++++++++++++++++++++++++++++
> src/intel/vulkan/anv_device.c | 9 +-
> src/intel/vulkan/anv_private.h | 40 ++++++++
> 3 files changed, 242 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_allocator.c b/src/intel/vulkan/anv_allocator.c
> index efaaebc..204c466 100644
> --- a/src/intel/vulkan/anv_allocator.c
> +++ b/src/intel/vulkan/anv_allocator.c
> @@ -1422,3 +1422,197 @@ anv_bo_cache_release(struct anv_device *device,
>
> vk_free(&device->alloc, bo);
> }
> +
> +VkResult
> +anv_syncobj_cache_init(struct anv_syncobj_cache *cache)
> +{
> + cache->map = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
> + _mesa_key_pointer_equal);
Not hash_uint for u32? Bah, for the number of ht mesa creates for
looking up u32 names, you would think it would have an ultra-specialised
data struct for it. :(
-Chris
More information about the mesa-dev
mailing list