diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-11-04 15:19:02 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-11-04 20:18:17 +0100 |
commit | cecbcf4b2de9e495969b7a25ce06ba7c3fabeb6c (patch) | |
tree | 123d13fd4c7b962c82dd1e151b7b0f96a48285b8 /src/amd/vulkan/radv_private.h | |
parent | b041687ed1e641a79237752a5ffe099d731e13e9 (diff) |
radv: Use an array to store descriptor sets.
The vram_list linked list resulted in lots of pointer chasing.
Replacing this with an array instead improves descriptor set
allocation CPU usage by 3x at least (when also considering the free),
because it had to iterate through 300-400 sets on average.
Not a huge improvement as the pre-improvement CPU usage was only
about 2.3% in the busiest thread.
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_private.h')
-rw-r--r-- | src/amd/vulkan/radv_private.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 83965b41b27..51bdde20323 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -612,8 +612,6 @@ struct radv_descriptor_set { uint32_t *mapped_ptr; struct radv_descriptor_range *dynamic_descriptors; - struct list_head vram_list; - struct radeon_winsys_bo *descriptors[0]; }; @@ -623,17 +621,25 @@ struct radv_push_descriptor_set uint32_t capacity; }; +struct radv_descriptor_pool_entry { + uint32_t offset; + uint32_t size; + struct radv_descriptor_set *set; +}; + struct radv_descriptor_pool { struct radeon_winsys_bo *bo; uint8_t *mapped_ptr; uint64_t current_offset; uint64_t size; - struct list_head vram_list; - uint8_t *host_memory_base; uint8_t *host_memory_ptr; uint8_t *host_memory_end; + + uint32_t entry_count; + uint32_t max_entry_count; + struct radv_descriptor_pool_entry entries[0]; }; struct radv_descriptor_update_template_entry { |