vulkan: expose ff_vk_alloc_mem()
This commit is contained in:
@@ -174,9 +174,9 @@ void ff_vk_qf_rotate(FFVkQueueFamilyCtx *qf)
|
|||||||
qf->cur_queue = (qf->cur_queue + 1) % qf->nb_queues;
|
qf->cur_queue = (qf->cur_queue + 1) % qf->nb_queues;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
|
int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
|
||||||
VkMemoryPropertyFlagBits req_flags, void *alloc_extension,
|
VkMemoryPropertyFlagBits req_flags, void *alloc_extension,
|
||||||
VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem)
|
VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem)
|
||||||
{
|
{
|
||||||
VkResult ret;
|
VkResult ret;
|
||||||
int index = -1;
|
int index = -1;
|
||||||
@@ -225,7 +225,8 @@ static int vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
*mem_flags |= s->mprops.memoryTypes[index].propertyFlags;
|
if (mem_flags)
|
||||||
|
*mem_flags |= s->mprops.memoryTypes[index].propertyFlags;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -279,9 +280,9 @@ int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, void *pNe
|
|||||||
if (use_ded_mem)
|
if (use_ded_mem)
|
||||||
ded_alloc.buffer = buf->buf;
|
ded_alloc.buffer = buf->buf;
|
||||||
|
|
||||||
err = vk_alloc_mem(s, &req.memoryRequirements, flags,
|
err = ff_vk_alloc_mem(s, &req.memoryRequirements, flags,
|
||||||
use_ded_mem ? &ded_alloc : (void *)ded_alloc.pNext,
|
use_ded_mem ? &ded_alloc : (void *)ded_alloc.pNext,
|
||||||
&buf->flags, &buf->mem);
|
&buf->flags, &buf->mem);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|||||||
@@ -258,6 +258,13 @@ const char *ff_vk_shader_rep_fmt(enum AVPixelFormat pixfmt);
|
|||||||
*/
|
*/
|
||||||
void ff_vk_qf_fill(FFVulkanContext *s);
|
void ff_vk_qf_fill(FFVulkanContext *s);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate device memory.
|
||||||
|
*/
|
||||||
|
int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
|
||||||
|
VkMemoryPropertyFlagBits req_flags, void *alloc_extension,
|
||||||
|
VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize a queue family with a specific number of queues.
|
* Initialize a queue family with a specific number of queues.
|
||||||
* If nb_queues == 0, use however many queues the queue family has.
|
* If nb_queues == 0, use however many queues the queue family has.
|
||||||
|
|||||||
Reference in New Issue
Block a user