diff options
author | Jason Ekstrand <[email protected]> | 2017-05-17 11:14:06 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2017-06-02 23:04:01 +0200 |
commit | 0f042901e3cd451f9a7630376083a805328aebe3 (patch) | |
tree | d42318cf7bff6a81e2a685540c9d4a4dd4571363 /src/intel/vulkan/anv_private.h | |
parent | 15bc6d4d210eee051407a816811012eba0a3be3b (diff) |
anv: Add valid_bufer_usage to the memory type metadata
Instead of returning valid types as just a number, we now walk the list
and check the buffer's usage against the usage flags we store in the new
anv_memory_type structure. Currently, valid_buffer_usage == ~0.
Reviewed-by: Nanley Chery <[email protected]>
Cc: "17.1" <[email protected]>
(cherry picked from commit f7736ccf53eaeb66c4270afe0916e2cb29ab8667)
[Juan A. Suarez: resolve trivial conflicts]
Signed-off-by: Juan A. Suarez Romero <[email protected]>
Conflicts:
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_private.h
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r-- | src/intel/vulkan/anv_private.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 21432b4c353..61f90ea1ae3 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -604,6 +604,15 @@ struct anv_bo *anv_scratch_pool_alloc(struct anv_device *device, gl_shader_stage stage, unsigned per_thread_scratch); +struct anv_memory_type { + /* Standard bits passed on to the client */ + VkMemoryPropertyFlags propertyFlags; + uint32_t heapIndex; + + /* Driver-internal book-keeping */ + VkBufferUsageFlags valid_buffer_usage; +}; + struct anv_physical_device { VK_LOADER_DATA _loader_data; @@ -633,7 +642,7 @@ struct anv_physical_device { struct { uint32_t type_count; - VkMemoryType types[VK_MAX_MEMORY_TYPES]; + struct anv_memory_type types[VK_MAX_MEMORY_TYPES]; uint32_t heap_count; VkMemoryHeap heaps[VK_MAX_MEMORY_HEAPS]; } memory; @@ -971,7 +980,7 @@ _anv_combine_address(struct anv_batch *batch, void *location, struct anv_device_memory { struct anv_bo bo; - VkMemoryType * type; + struct anv_memory_type * type; VkDeviceSize map_size; void * map; }; |