diff options
author | Bas Nieuwenhuizen <[email protected]> | 2018-08-10 13:30:08 +0200 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2019-03-11 10:01:33 -0700 |
commit | 462b693d943b8ba4cf80db9bc5238819ca798012 (patch) | |
tree | 2d3e9c46081c58487b6de35921979e4f99b1c154 | |
parent | 8e52e8183c2dec8bf0ef85284f8883dc392b7acd (diff) |
turnip: Report a memory type and heap.
-rw-r--r-- | src/freedreno/vulkan/tu_device.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index e0c27166818..cbcc7977544 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -874,12 +874,28 @@ tu_GetPhysicalDeviceQueueFamilyProperties2( assert(*pCount <= 1); } +static uint64_t +tu_get_system_memory_size() +{ + uint64_t pages = sysconf(_SC_PHYS_PAGES); + uint64_t page_size = sysconf(_SC_PAGE_SIZE); + return pages * page_size; +} + void tu_GetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) { - stub(); + pMemoryProperties->memoryHeapCount = 1; + pMemoryProperties->memoryHeaps[0].size = tu_get_system_memory_size(); + pMemoryProperties->memoryHeaps[0].flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT; + + pMemoryProperties->memoryTypeCount = 1; + pMemoryProperties->memoryTypes[0].propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | + VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + pMemoryProperties->memoryTypes[0].heapIndex = 0; } void |