Skip to content
Snippets Groups Projects
Commit 68b02d38 authored by Niklas Haas's avatar Niklas Haas
Browse files

malloc: cosmetic

parent 20bddcc1
No related branches found
Tags v1.7.0-rc2
No related merge requests found
......@@ -153,25 +153,20 @@ static struct vk_slab *slab_alloc(struct vk_malloc *ma, struct vk_heap *heap,
.end = slab->size,
});
VkExportMemoryAllocateInfoKHR ext_info = {
.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR,
.handleTypes = 0,
};
VkExternalMemoryBufferCreateInfoKHR ext_buf_info = {
.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR,
.handleTypes = 0,
};
VkExternalMemoryHandleTypeFlags handle_type_vk = 0;
switch (heap->handle_type) {
case PL_HANDLE_FD:
ext_info.handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
ext_buf_info.handleTypes |= VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
handle_type_vk = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
slab->handle_type = PL_HANDLE_FD;
slab->handle.fd = -1;
break;
}
VkExportMemoryAllocateInfoKHR ext_info = {
.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR,
.handleTypes = handle_type_vk,
};
VkMemoryAllocateInfo minfo = {
.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
.pNext = heap->handle_type ? &ext_info : NULL,
......@@ -188,6 +183,11 @@ static struct vk_slab *slab_alloc(struct vk_malloc *ma, struct vk_heap *heap,
for (int i = 0; i < vk->num_pools; i++)
qfs[i] = vk->pools[i]->qf;
VkExternalMemoryBufferCreateInfoKHR ext_buf_info = {
.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR,
.handleTypes = handle_type_vk,
};
VkBufferCreateInfo binfo = {
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.pNext = heap->handle_type ? &ext_buf_info : NULL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment