mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
vulkan_decode: do not bind the current picture twice when its slot is active
When decoding the second field of a pair, the picture is already bound as an active reference at its DPB slot, since the first field made it one. Appending it again as an inactive slot duplicates the picture resource within the coding scope, which is not allowed (VUID-vkCmdBeginVideoCodingKHR-pPictureResource-07238).
This commit is contained in:
1 parent
daa210cfd7
commit
0ae15fffef
1 file changed
+13
-6
@@ -460,12 +460,19 @@ int ff_vk_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
FFVkExecContext *exec = ff_vk_exec_get(&ctx->s, &ctx->exec_pool);
|
||||
|
||||
/* The current decoding reference has to be bound as an inactive reference */
|
||||
VkVideoReferenceSlotInfoKHR *cur_vk_ref;
|
||||
cur_vk_ref = (void *)&decode_start.pReferenceSlots[decode_start.referenceSlotCount];
|
||||
cur_vk_ref[0] = vp->ref_slot;
|
||||
cur_vk_ref[0].slotIndex = -1;
|
||||
decode_start.referenceSlotCount++;
|
||||
/* The current picture's resource has to be bound as an inactive
|
||||
* reference, unless its slot is already bound as an active one, as when
|
||||
* decoding the second field of a pair. */
|
||||
int cur_bound = 0;
|
||||
for (int i = 0; i < decode_start.referenceSlotCount; i++)
|
||||
cur_bound |= decode_start.pReferenceSlots[i].slotIndex == vp->ref_slot.slotIndex;
|
||||
if (!cur_bound) {
|
||||
VkVideoReferenceSlotInfoKHR *cur_vk_ref;
|
||||
cur_vk_ref = (void *)&decode_start.pReferenceSlots[decode_start.referenceSlotCount];
|
||||
cur_vk_ref[0] = vp->ref_slot;
|
||||
cur_vk_ref[0].slotIndex = -1;
|
||||
decode_start.referenceSlotCount++;
|
||||
}
|
||||
|
||||
sd_buf = vp->slices_buf;
|
||||
|
||||
|
||||
Reference in new issue
Block a user