History

hwcontext_vulkan: add PREP_MODE_GENERAL for non-transfer_dst images

Vulkan filters don't need images which can be transferred into.

Lynne committed 2 years ago

Commit c41ef7f1 parent 66e950f1 file · +8 −1Browse files

Unified · Split

libavutil/hwcontext_vulkan.c+8−1
@@ -2187,6 +2187,7 @@ static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f, · 2186 unmodified lines
2187}2187}
2188 2188
2189enum PrepMode {2189enum 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 else2528 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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t