[FFmpeg-devel] [PATCH] libavutil/vulkan: Expose ff_vk_set_descriptor_image
Lynne
dev at lynne.ee
Fri Feb 28 14:45:37 EET 2025
On 28/02/2025 08:49, IndecisiveTurtle wrote:
> 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.
Thanks, pushed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250228/e64ac041/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250228/e64ac041/attachment.sig>
More information about the ffmpeg-devel
mailing list