mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
vulkan: Move vulkan_fence_create to vulkan-utils
This function is independent from compute. No functional changes.
This commit is contained in:
parent
51b7d49cff
commit
e5f89e09d1
3 changed files with 13 additions and 11 deletions
|
|
@ -31,16 +31,6 @@
|
|||
#define VULKAN_INSTANCE_FUNCTION(name) \
|
||||
PFN_##name name = (PFN_##name)vkGetInstanceProcAddr(s->base.instance, #name)
|
||||
|
||||
static int createFence(struct vulkan_compute_state *s) {
|
||||
VkFenceCreateInfo createInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
|
||||
.flags = 0,
|
||||
};
|
||||
VK_CHECK_RESULT(vkCreateFence(s->base.device, &createInfo, NULL, &s->fence));
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
static int createDescriptors(struct vulkan_compute_state *s)
|
||||
{
|
||||
uint32_t i;
|
||||
|
|
@ -562,7 +552,7 @@ int spa_vulkan_compute_init_stream(struct vulkan_compute_state *s, struct vulkan
|
|||
int spa_vulkan_compute_prepare(struct vulkan_compute_state *s)
|
||||
{
|
||||
if (!s->prepared) {
|
||||
CHECK(createFence(s));
|
||||
CHECK(vulkan_fence_create(&s->base, &s->fence));
|
||||
CHECK(createDescriptors(s));
|
||||
CHECK(createComputePipeline(s, s->shaderName));
|
||||
CHECK(createCommandBuffer(s));
|
||||
|
|
|
|||
|
|
@ -420,6 +420,17 @@ bool vulkan_sync_export_dmabuf(struct vulkan_base *s, struct vulkan_buffer *vk_b
|
|||
return dmabuf_import_sync_file(s->log, vk_buf->fd, DMA_BUF_SYNC_WRITE, sync_file_fd);
|
||||
}
|
||||
|
||||
int vulkan_fence_create(struct vulkan_base *s, VkFence *fence)
|
||||
{
|
||||
VkFenceCreateInfo createInfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,
|
||||
.flags = 0,
|
||||
};
|
||||
VK_CHECK_RESULT(vkCreateFence(s->device, &createInfo, NULL, fence));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int vulkan_commandPool_create(struct vulkan_base *s, VkCommandPool *commandPool)
|
||||
{
|
||||
const VkCommandPoolCreateInfo commandPoolCreateInfo = {
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ int vulkan_create_dmabuf(struct vulkan_base *s, struct external_buffer_info *inf
|
|||
int vulkan_import_dmabuf(struct vulkan_base *s, struct external_buffer_info *info, struct vulkan_buffer *vk_buf);
|
||||
int vulkan_import_memptr(struct vulkan_base *s, struct external_buffer_info *info, struct vulkan_buffer *vk_buf);
|
||||
|
||||
int vulkan_fence_create(struct vulkan_base *s, VkFence *fence);
|
||||
int vulkan_commandPool_create(struct vulkan_base *s, VkCommandPool *commandPool);
|
||||
int vulkan_commandBuffer_create(struct vulkan_base *s, VkCommandPool commandPool, VkCommandBuffer *commandBuffer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue