Vulkan filters don't need images which can be transferred into.
Unified · Split
| @@ -2187,6 +2187,7 @@ static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f, · 2186 unmodified lines | |||
| 2187 | } | 2187 | } |
| 2188 | 2188 | ||
| 2189 | enum PrepMode { | 2189 | enum PrepMode { |
| 2190 | PREP_MODE_GENERAL, | ||
| 2190 | PREP_MODE_WRITE, | 2191 | PREP_MODE_WRITE, |
| 2191 | PREP_MODE_EXTERNAL_EXPORT, | 2192 | PREP_MODE_EXTERNAL_EXPORT, |
| 2192 | PREP_MODE_EXTERNAL_IMPORT, | 2193 | PREP_MODE_EXTERNAL_IMPORT, |
| @@ -2232,6 +2233,10 @@ static int prepare_frame(AVHWFramesContext *hwfc, FFVkExecPool *ectx, · 39 unmodified lines | |||
| 2232 | return err; | 2233 | return err; |
| 2233 | 2234 | ||
| 2234 | switch (pmode) { | 2235 | switch (pmode) { |
| 2236 | case PREP_MODE_GENERAL: | ||
| 2237 | new_layout = VK_IMAGE_LAYOUT_GENERAL; | ||
| 2238 | new_access = VK_ACCESS_TRANSFER_WRITE_BIT; | ||
| 2239 | break; | ||
| 2235 | case PREP_MODE_WRITE: | 2240 | case PREP_MODE_WRITE: |
| 2236 | new_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; | 2241 | new_layout = VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL; |
| 2237 | new_access = VK_ACCESS_TRANSFER_WRITE_BIT; | 2242 | new_access = VK_ACCESS_TRANSFER_WRITE_BIT; |
| @@ -2520,8 +2525,10 @@ static AVBufferRef *vulkan_pool_alloc(void *opaque, size_t size) · 282 unmodified lines | |||
| 2520 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_DECODING_DST); | 2525 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_DECODING_DST); |
| 2521 | else if (hwctx->usage & VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR) | 2526 | else if (hwctx->usage & VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR) |
| 2522 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_ENCODING_DPB); | 2527 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_ENCODING_DPB); |
| 2523 | else | 2528 | else if (hwctx->usage & VK_IMAGE_USAGE_TRANSFER_DST_BIT) |
| 2524 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_WRITE); | 2529 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_WRITE); |
| 2530 | else | ||
| 2531 | err = prepare_frame(hwfc, &fp->compute_exec, f, PREP_MODE_GENERAL); | ||
| 2525 | if (err) | 2532 | if (err) |
| 2526 | goto fail; | 2533 | goto fail; |
| 2527 | 2534 | ||