summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_device.c
diff options
context:
space:
mode:
authorFredrik Höglund <[email protected]>2016-10-27 02:49:59 +0200
committerDave Airlie <[email protected]>2016-10-28 12:27:49 +1000
commit044ef54d65e5f64126755503eefa411b1bdb8816 (patch)
tree17f229cfd1412c1ef162dbd0eaa425ac7294c65c /src/amd/vulkan/radv_device.c
parentc9675b4e17e10abef9886b0aacb84e196655e510 (diff)
radv: split the device local memory heap into two
Advertise two device local memory heaps; one that is host visible and one that is not. This makes it possible for clients to tell how much host visible vs. non-host visible memory is available. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r--src/amd/vulkan/radv_device.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 86505f40045..512d366722d 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -530,27 +530,32 @@ void radv_GetPhysicalDeviceMemoryProperties(
pMemoryProperties->memoryTypes[1] = (VkMemoryType) {
.propertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- .heapIndex = 1,
+ .heapIndex = 2,
};
pMemoryProperties->memoryTypes[2] = (VkMemoryType) {
.propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- .heapIndex = 0,
+ .heapIndex = 1,
};
pMemoryProperties->memoryTypes[3] = (VkMemoryType) {
.propertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
- .heapIndex = 1,
+ .heapIndex = 2,
};
- pMemoryProperties->memoryHeapCount = 2;
+ pMemoryProperties->memoryHeapCount = 3;
pMemoryProperties->memoryHeaps[0] = (VkMemoryHeap) {
- .size = physical_device->rad_info.vram_size,
+ .size = physical_device->rad_info.vram_size -
+ physical_device->rad_info.visible_vram_size,
.flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT,
};
pMemoryProperties->memoryHeaps[1] = (VkMemoryHeap) {
+ .size = physical_device->rad_info.visible_vram_size,
+ .flags = VK_MEMORY_HEAP_DEVICE_LOCAL_BIT,
+ };
+ pMemoryProperties->memoryHeaps[2] = (VkMemoryHeap) {
.size = physical_device->rad_info.gart_size,
.flags = 0,
};