summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2020-04-06 18:18:50 +0100
committerLynne <dev@lynne.ee>2020-04-07 12:52:56 +0100
commit97b526c192add6f252b327245fd9223546867352 (patch)
tree8676075031430d923be525dc82944e77449368a9 /libavfilter
parent3f9fd9dcfdf090f81f7fd22ddc6f6d571f4c5516 (diff)
hwcontext_vulkan: only use one semaphore per image
The idea was to allow separate planes to be filtered independently, however, in hindsight, literaly nothing uses separate per-plane semaphores and it would only work when each plane is backed by separate device memory.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vulkan.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/libavfilter/vulkan.c b/libavfilter/vulkan.c
index ff76ab15e9..c103440529 100644
--- a/libavfilter/vulkan.c
+++ b/libavfilter/vulkan.c
@@ -390,32 +390,28 @@ int ff_vk_add_exec_dep(AVFilterContext *avctx, FFVkExecContext *e,
AVFrame *frame, VkPipelineStageFlagBits in_wait_dst_flag)
{
AVVkFrame *f = (AVVkFrame *)frame->data[0];
- AVHWFramesContext *fc = (AVHWFramesContext *)frame->hw_frames_ctx->data;
- int planes = av_pix_fmt_count_planes(fc->sw_format);
- for (int i = 0; i < planes; i++) {
- e->sem_wait = av_fast_realloc(e->sem_wait, &e->sem_wait_alloc,
- (e->sem_wait_cnt + 1)*sizeof(*e->sem_wait));
- if (!e->sem_wait)
- return AVERROR(ENOMEM);
+ e->sem_wait = av_fast_realloc(e->sem_wait, &e->sem_wait_alloc,
+ (e->sem_wait_cnt + 1)*sizeof(*e->sem_wait));
+ if (!e->sem_wait)
+ return AVERROR(ENOMEM);
- e->sem_wait_dst = av_fast_realloc(e->sem_wait_dst, &e->sem_wait_dst_alloc,
- (e->sem_wait_cnt + 1)*sizeof(*e->sem_wait_dst));
- if (!e->sem_wait_dst)
- return AVERROR(ENOMEM);
+ e->sem_wait_dst = av_fast_realloc(e->sem_wait_dst, &e->sem_wait_dst_alloc,
+ (e->sem_wait_cnt + 1)*sizeof(*e->sem_wait_dst));
+ if (!e->sem_wait_dst)
+ return AVERROR(ENOMEM);
- e->sem_sig = av_fast_realloc(e->sem_sig, &e->sem_sig_alloc,
- (e->sem_sig_cnt + 1)*sizeof(*e->sem_sig));
- if (!e->sem_sig)
- return AVERROR(ENOMEM);
+ e->sem_sig = av_fast_realloc(e->sem_sig, &e->sem_sig_alloc,
+ (e->sem_sig_cnt + 1)*sizeof(*e->sem_sig));
+ if (!e->sem_sig)
+ return AVERROR(ENOMEM);
- e->sem_wait[e->sem_wait_cnt] = f->sem[i];
- e->sem_wait_dst[e->sem_wait_cnt] = in_wait_dst_flag;
- e->sem_wait_cnt++;
+ e->sem_wait[e->sem_wait_cnt] = f->sem;
+ e->sem_wait_dst[e->sem_wait_cnt] = in_wait_dst_flag;
+ e->sem_wait_cnt++;
- e->sem_sig[e->sem_sig_cnt] = f->sem[i];
- e->sem_sig_cnt++;
- }
+ e->sem_sig[e->sem_sig_cnt] = f->sem;
+ e->sem_sig_cnt++;
return 0;
}