radv: add 32-bit memory types for visible VRAM and cached GTT
These would be only exposed for descriptor buffers which need to be CPU accessible and because descriptor pointers are 32-bit. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19808>
This commit is contained in:
@@ -276,6 +276,15 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device)
|
||||
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
.heapIndex = visible_vram_index,
|
||||
};
|
||||
|
||||
device->memory_domains[type_count] = RADEON_DOMAIN_VRAM;
|
||||
device->memory_flags[type_count] = RADEON_FLAG_CPU_ACCESS | RADEON_FLAG_32BIT;
|
||||
device->memory_properties.memoryTypes[type_count++] = (VkMemoryType){
|
||||
.propertyFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
|
||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
|
||||
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||
.heapIndex = visible_vram_index,
|
||||
};
|
||||
}
|
||||
|
||||
if (gart_index >= 0) {
|
||||
@@ -286,6 +295,14 @@ radv_physical_device_init_mem_types(struct radv_physical_device *device)
|
||||
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
|
||||
.heapIndex = gart_index,
|
||||
};
|
||||
|
||||
device->memory_domains[type_count] = RADEON_DOMAIN_GTT;
|
||||
device->memory_flags[type_count] = RADEON_FLAG_CPU_ACCESS | RADEON_FLAG_32BIT;
|
||||
device->memory_properties.memoryTypes[type_count++] = (VkMemoryType){
|
||||
.propertyFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT |
|
||||
VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT,
|
||||
.heapIndex = gart_index,
|
||||
};
|
||||
}
|
||||
device->memory_properties.memoryTypeCount = type_count;
|
||||
|
||||
|
Reference in New Issue
Block a user