1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

libavutil/vulkan: Expose ff_vk_set_descriptor_image

Useful when creating a descriptor array of separate images
This commit is contained in:
IndecisiveTurtle
2025-02-28 09:49:11 +02:00
committed by Lynne
parent 9993a64d7b
commit b37ce9b016
2 changed files with 14 additions and 6 deletions

View File

@@ -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, int ff_vk_set_descriptor_image(FFVulkanContext *s, FFVulkanShader *shd,
FFVkExecContext *e, int set, int bind, int offs, FFVkExecContext *e, int set, int bind, int offs,
VkImageView view, VkImageLayout layout, VkImageView view, VkImageLayout layout,
VkSampler sampler) VkSampler sampler)
{ {
FFVulkanDescriptorSet *desc_set = &shd->desc_set[set]; 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); const int nb_planes = av_pix_fmt_count_planes(hwfc->sw_format);
for (int i = 0; i < nb_planes; i++) for (int i = 0; i < nb_planes; i++)
vk_set_descriptor_image(s, shd, e, set, binding, i, ff_vk_set_descriptor_image(s, shd, e, set, binding, i,
views[i], layout, sampler); views[i], layout, sampler);
} }
void ff_vk_shader_update_push_const(FFVulkanContext *s, FFVkExecContext *e, void ff_vk_shader_update_push_const(FFVulkanContext *s, FFVkExecContext *e,

View File

@@ -590,6 +590,14 @@ int ff_vk_shader_update_desc_buffer(FFVulkanContext *s, FFVkExecContext *e,
FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize len, FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize len,
VkFormat fmt); VkFormat fmt);
/**
* 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 an image array.. * Update a descriptor in a buffer with an image array..
* Must be called before binding the shader. * Must be called before binding the shader.