diff options
author | Jason Ekstrand <[email protected]> | 2019-02-26 18:05:34 -0600 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-04-19 19:56:42 +0000 |
commit | 83b943cc2f2408087795ee2bd984477a1749a530 (patch) | |
tree | 3738c9ebfa9d4a5107675ddd8b5f7714ae4a1609 /src/intel/vulkan/anv_private.h | |
parent | a9241edfa3ed1ccf9b5635d1313d88e532d46cd5 (diff) |
anv: Make all VkDeviceMemory BOs resident permanently
We spend a lot of time in the driver adding things to hash sets to track
residency. The reality is that a properly built Vulkan app uses large
memory objects and sub-allocates from them. In a typical frame, most of
if not all of those allocations are going to be resident for the entire
frame so we're really not saving ourselves much by tracking fine-grained
residency. Just throwing everything in the validation list does make it
a little bit more expensive inside the kernel to walk the list and
ensure that all our VA is in order. However, without relocations, the
overhead of that is pretty small.
If we ever do run into a memory pressure situation where the fine-
grained residency could even potentially help, we would likely be
swapping one page out to make room for another within the draw call and
performance is totally lost at that point. We're better off swapping
out other apps and just letting ours run a whole frame.
Reviewed-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 80416ea8f81..bfeade7ce48 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -1093,6 +1093,9 @@ struct anv_device { uint64_t vma_lo_available; uint64_t vma_hi_available; + /** List of all anv_device_memory objects */ + struct list_head memory_objects; + struct anv_bo_pool batch_bo_pool; struct anv_bo_cache bo_cache; @@ -1106,12 +1109,6 @@ struct anv_device { struct anv_bo trivial_batch_bo; struct anv_bo hiz_clear_bo; - /* Set of pointers to anv_buffer objects for all pinned buffers. Pinned - * buffers are always resident because they could be used at any time via - * VK_EXT_buffer_device_address. - */ - struct set * pinned_buffers; - struct anv_pipeline_cache default_pipeline_cache; struct blorp_context blorp; @@ -1483,6 +1480,8 @@ _anv_combine_address(struct anv_batch *batch, void *location, #define GEN11_EXTERNAL_MOCS GEN9_EXTERNAL_MOCS struct anv_device_memory { + struct list_head link; + struct anv_bo * bo; struct anv_memory_type * type; VkDeviceSize map_size; |