[FFmpeg-devel] [PATCH] libavutil/vulkan: Expose ff_vk_set_descriptor_image
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Fri Feb 28 15:38:21 EET 2025
IndecisiveTurtle:
> Useful when creating a descriptor array of separate images
> ---
> libavutil/vulkan.c | 12 ++++++------
> libavutil/vulkan.h | 8 ++++++++
> 2 files changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
> index 31610e2d94..91415957fd 100644
> --- a/libavutil/vulkan.c
> +++ b/libavutil/vulkan.c
> @@ -2381,10 +2381,10 @@ static inline void update_set_pool_write(FFVulkanContext *s, FFVkExecContext *e,
> }
> }
>
> -static int vk_set_descriptor_image(FFVulkanContext *s, FFVulkanShader *shd,
> - FFVkExecContext *e, int set, int bind, int offs,
> - VkImageView view, VkImageLayout layout,
> - VkSampler sampler)
> +int ff_vk_set_descriptor_image(FFVulkanContext *s, FFVulkanShader *shd,
> + FFVkExecContext *e, int set, int bind, int offs,
> + VkImageView view, VkImageLayout layout,
> + VkSampler sampler)
> {
> FFVulkanDescriptorSet *desc_set = &shd->desc_set[set];
>
> @@ -2521,8 +2521,8 @@ void ff_vk_shader_update_img_array(FFVulkanContext *s, FFVkExecContext *e,
> const int nb_planes = av_pix_fmt_count_planes(hwfc->sw_format);
>
> for (int i = 0; i < nb_planes; i++)
> - vk_set_descriptor_image(s, shd, e, set, binding, i,
> - views[i], layout, sampler);
> + ff_vk_set_descriptor_image(s, shd, e, set, binding, i,
> + views[i], layout, sampler);
> }
>
> void ff_vk_shader_update_push_const(FFVulkanContext *s, FFVkExecContext *e,
> diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
> index 8690c13b3d..eb80c84d26 100644
> --- a/libavutil/vulkan.h
> +++ b/libavutil/vulkan.h
> @@ -580,6 +580,14 @@ void ff_vk_shader_update_push_const(FFVulkanContext *s, FFVkExecContext *e,
> VkShaderStageFlagBits stage,
> int offset, size_t size, void *src);
>
> +/**
> + * Sets an image descriptor for specified shader and binding.
> + */
> +int ff_vk_set_descriptor_image(FFVulkanContext *s, FFVulkanShader *shd,
> + FFVkExecContext *e, int set, int bind, int offs,
> + VkImageView view, VkImageLayout layout,
> + VkSampler sampler);
> +
> /**
> * Update a descriptor in a buffer with a buffer.
> * Must be called before binding the shader.
This should have been in the same patchset that uses it.
- Andreas
More information about the ffmpeg-devel
mailing list