diff options
author | Jason Ekstrand <[email protected]> | 2017-05-17 11:38:16 -0700 |
---|---|---|
committer | Juan A. Suarez Romero <[email protected]> | 2017-06-02 23:04:01 +0200 |
commit | 2562b3252b63f2e938d6e6614e1f9a2fa2064140 (patch) | |
tree | b5e7650e8934fbc0b18fe94a2310610de32df852 | |
parent | 86a8854b118fd42d157a5b640fa7a3a1cad92301 (diff) |
anv: Make supports_48bit_addresses a heap property
Reviewed-by: Nanley Chery <[email protected]>
Cc: "17.1" <[email protected]>
(cherry picked from commit b83b1af6f6936f36db42a8f8b8e0854d0f9491fd)
[Juan A. Suarez: resolve trivial conflicts]
Signed-off-by: Juan A. Suarez Romero <[email protected]>
Conflicts:
src/intel/vulkan/anv_device.c
-rw-r--r-- | src/intel/vulkan/anv_device.c | 6 | ||||
-rw-r--r-- | src/intel/vulkan/anv_private.h | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index b07def96288..95a29ab72d2 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -149,9 +149,10 @@ anv_physical_device_init_heaps(struct anv_physical_device *device, int fd) } device->memory.heap_count = 1; - device->memory.heaps[0] = (VkMemoryHeap) { + device->memory.heaps[0] = (struct anv_memory_heap) { .size = heap_size, .flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT, + .supports_48bit_addresses = device->supports_48bit_addresses, }; return VK_SUCCESS; @@ -1621,7 +1622,8 @@ VkResult anv_AllocateMemory( mem->map = NULL; mem->map_size = 0; - if (pdevice->supports_48bit_addresses) + assert(mem->type->heapIndex < pdevice->memory.heap_count); + if (pdevice->memory.heaps[mem->type->heapIndex].supports_48bit_addresses) mem->bo.flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS; if (pdevice->has_exec_async) diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 61f90ea1ae3..ad82c77ec15 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -613,6 +613,15 @@ struct anv_memory_type { VkBufferUsageFlags valid_buffer_usage; }; +struct anv_memory_heap { + /* Standard bits passed on to the client */ + VkDeviceSize size; + VkMemoryHeapFlags flags; + + /* Driver-internal book-keeping */ + bool supports_48bit_addresses; +}; + struct anv_physical_device { VK_LOADER_DATA _loader_data; @@ -644,7 +653,7 @@ struct anv_physical_device { uint32_t type_count; struct anv_memory_type types[VK_MAX_MEMORY_TYPES]; uint32_t heap_count; - VkMemoryHeap heaps[VK_MAX_MEMORY_HEAPS]; + struct anv_memory_heap heaps[VK_MAX_MEMORY_HEAPS]; } memory; uint8_t pipeline_cache_uuid[VK_UUID_SIZE]; |