From b5e333bba7cd0657c48b4ec996bc91fffec9d3e7 Mon Sep 17 00:00:00 2001 From: Lynne Date: Thu, 17 Mar 2022 12:23:56 +0100 Subject: [PATCH] vulkan: add pNext argument to ff_vk_create_buf() --- libavfilter/vf_gblur_vulkan.c | 2 +- libavfilter/vf_overlay_vulkan.c | 2 +- libavfilter/vf_scale_vulkan.c | 2 +- libavutil/vulkan.c | 4 ++-- libavutil/vulkan.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_gblur_vulkan.c b/libavfilter/vf_gblur_vulkan.c index e6ffc8c073..80d1dc61c0 100644 --- a/libavfilter/vf_gblur_vulkan.c +++ b/libavfilter/vf_gblur_vulkan.c @@ -174,7 +174,7 @@ static int init_gblur_pipeline(GBlurVulkanContext *s, FFVulkanPipeline *pl, FFVk RET(ff_vk_init_pipeline_layout(&s->vkctx, pl)); RET(ff_vk_init_compute_pipeline(&s->vkctx, pl)); - RET(ff_vk_create_buf(&s->vkctx, params_buf, sizeof(float) * ksize, + RET(ff_vk_create_buf(&s->vkctx, params_buf, sizeof(float) * ksize, NULL, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)); RET(ff_vk_map_buffers(&s->vkctx, params_buf, &kernel_mapped, 1, 0)); diff --git a/libavfilter/vf_overlay_vulkan.c b/libavfilter/vf_overlay_vulkan.c index 6db7baddfd..7a66cf12ad 100644 --- a/libavfilter/vf_overlay_vulkan.c +++ b/libavfilter/vf_overlay_vulkan.c @@ -181,7 +181,7 @@ static av_cold int init_filter(AVFilterContext *ctx) } *par; err = ff_vk_create_buf(vkctx, &s->params_buf, - sizeof(*par), + sizeof(*par), NULL, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT); if (err) diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c index 3b09f0dcc1..d14b32277d 100644 --- a/libavfilter/vf_scale_vulkan.c +++ b/libavfilter/vf_scale_vulkan.c @@ -253,7 +253,7 @@ static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in) } RET(ff_vk_create_buf(vkctx, &s->params_buf, - sizeof(*par), + sizeof(*par), NULL, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)); diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index f2846e628a..ae6adc5104 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -205,7 +205,7 @@ static int vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req, return 0; } -int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, +int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, void *pNext, VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags) { int err; @@ -215,7 +215,7 @@ int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, VkBufferCreateInfo buf_spawn = { .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, - .pNext = NULL, + .pNext = pNext, .usage = usage, .sharingMode = VK_SHARING_MODE_EXCLUSIVE, .size = size, /* Gets FFALIGNED during alloc if host visible diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index 107c12a746..c6cfb779fc 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -397,7 +397,7 @@ int ff_vk_submit_exec_queue(FFVulkanContext *s, FFVkExecContext *e); /** * Create a VkBuffer with the specified parameters. */ -int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, +int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, void *pNext, VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags); /**