diff options
author | Lynne <dev@lynne.ee> | 2024-07-14 18:30:26 +0200 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2024-07-14 18:33:56 +0200 |
commit | 80ddc727178837a5ea5e6e463f28fedf6c1051dd (patch) | |
tree | 6d1718a70c0a37ea8f67252b4e9f9f5daddb0e7c /libavutil | |
parent | e11087b1629ed9df6c5810120b94597267684b17 (diff) | |
download | ffmpeg-80ddc727178837a5ea5e6e463f28fedf6c1051dd.tar.gz |
vulkan: rename read_only to singular
There's nothing stopping users from writing to such buffers.
Its more accurate to say they are singular, i.e. not duplicated
between multiple submissions.
This can be helpful for global statistics, or error propagation
purposes.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/vulkan.c | 10 | ||||
-rw-r--r-- | libavutil/vulkan.h | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index a9125ea6b9..11c17ee6f3 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -1465,7 +1465,7 @@ static const struct descriptor_props { int ff_vk_pipeline_descriptor_set_add(FFVulkanContext *s, FFVulkanPipeline *pl, FFVkSPIRVShader *shd, FFVulkanDescriptorSetBinding *desc, int nb, - int read_only, int print_to_shader_only) + int singular, int print_to_shader_only) { VkResult ret; int has_sampler = 0; @@ -1535,7 +1535,7 @@ int ff_vk_pipeline_descriptor_set_add(FFVulkanContext *s, FFVulkanPipeline *pl, vk->GetDescriptorSetLayoutBindingOffsetEXT(s->hwctx->act_dev, set->layout, i, &set->binding_offset[i]); - set->read_only = read_only; + set->singular = singular; set->nb_bindings = nb; pl->nb_descriptor_sets++; @@ -1592,7 +1592,7 @@ int ff_vk_exec_pipeline_register(FFVulkanContext *s, FFVkExecPool *pool, for (int i = 0; i < pl->nb_descriptor_sets; i++) { FFVulkanDescriptorSet *set = &pl->desc_set[i]; - int nb = set->read_only ? 1 : pool->pool_size; + int nb = set->singular ? 1 : pool->pool_size; err = ff_vk_create_buf(s, &set->buf, set->aligned_size*nb, NULL, NULL, set->usage, @@ -1624,7 +1624,7 @@ static inline void update_set_descriptor(FFVulkanContext *s, FFVkExecContext *e, size_t desc_size) { FFVulkanFunctions *vk = &s->vkfn; - const size_t exec_offset = set->read_only ? 0 : set->aligned_size*e->idx; + const size_t exec_offset = set->singular ? 0 : set->aligned_size*e->idx; void *desc = set->desc_mem + /* Base */ exec_offset + /* Execution context */ set->binding_offset[bind_idx] + /* Descriptor binding */ @@ -1831,7 +1831,7 @@ void ff_vk_exec_bind_pipeline(FFVulkanContext *s, FFVkExecContext *e, if (pl->nb_descriptor_sets) { for (int i = 0; i < pl->nb_descriptor_sets; i++) - offsets[i] = pl->desc_set[i].read_only ? 0 : pl->desc_set[i].aligned_size*e->idx; + offsets[i] = pl->desc_set[i].singular ? 0 : pl->desc_set[i].aligned_size*e->idx; /* Bind descriptor buffers */ vk->CmdBindDescriptorBuffersEXT(e->buf, pl->nb_descriptor_sets, pl->desc_bind); diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h index 15d954fcb8..81898841ad 100644 --- a/libavutil/vulkan.h +++ b/libavutil/vulkan.h @@ -125,7 +125,8 @@ typedef struct FFVulkanDescriptorSet { VkDeviceSize *binding_offset; int nb_bindings; - int read_only; + /* Descriptor set is shared between all submissions */ + int singular; } FFVulkanDescriptorSet; typedef struct FFVulkanPipeline { @@ -463,7 +464,7 @@ void ff_vk_update_push_exec(FFVulkanContext *s, FFVkExecContext *e, int ff_vk_pipeline_descriptor_set_add(FFVulkanContext *s, FFVulkanPipeline *pl, FFVkSPIRVShader *shd, FFVulkanDescriptorSetBinding *desc, int nb, - int read_only, int print_to_shader_only); + int singular, int print_to_shader_only); /* Initialize/free a pipeline. */ int ff_vk_init_compute_pipeline(FFVulkanContext *s, FFVulkanPipeline *pl, |