mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
vulkan: split spa_vulkan_use_buffers into separate allocation and import functions
This commit add helpers to create and to import a DmaBuf via the external_dmabuf_info struct. The import path is based on the image creation of wlroots and the create path is inspired by the wlroots vulkan allocator MR.
This commit is contained in:
parent
2068972bb3
commit
35b080ec61
3 changed files with 301 additions and 106 deletions
|
|
@ -2,6 +2,8 @@
|
|||
/* SPDX-FileCopyrightText: Copyright © 2019 Wim Taymans */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <spa/buffer/buffer.h>
|
||||
|
|
@ -34,6 +36,17 @@
|
|||
return _res; \
|
||||
}
|
||||
|
||||
struct external_dmabuf_info {
|
||||
VkFormat format;
|
||||
uint64_t modifier;
|
||||
struct spa_rectangle size;
|
||||
VkImageUsageFlags usage;
|
||||
struct spa_buffer *spa_buf;
|
||||
};
|
||||
|
||||
int vulkan_create_dmabuf(struct vulkan_base *s, struct external_dmabuf_info *info, struct vulkan_buffer *vk_buf);
|
||||
int vulkan_import_dmabuf(struct vulkan_base *s, struct external_dmabuf_info *info, struct vulkan_buffer *vk_buf);
|
||||
|
||||
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