mirror of https://git.ffmpeg.org/ffmpeg.git
avutil/hwcontext_vulkan: fixed incorrect memory offset
This commit fixed hwupload in Vulkan: ffmpeg -init_hw_device vulkan -i test.jpg -vf hwupload,hwdownload,format=yuv420p -y out.jpg Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
This commit is contained in:
parent
ce4d459db1
commit
c4ecc643bb
|
@ -1872,12 +1872,14 @@ static int alloc_bind_mem(AVHWFramesContext *hwfc, AVVkFrame *f,
|
|||
|
||||
f->size[0] = cont_memory_requirements.size;
|
||||
|
||||
for (int i = 0; i < planes; i++) {
|
||||
bind_info[i].sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO;
|
||||
bind_info[i].image = f->img[i];
|
||||
bind_info[i].memory = f->mem[0];
|
||||
bind_info[i].memoryOffset = !i ? 0 : cont_mem_size_list[i - 1];
|
||||
for (int i = 0, offset = 0; i < planes; i++) {
|
||||
bind_info[i].sType = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO;
|
||||
bind_info[i].image = f->img[i];
|
||||
bind_info[i].memory = f->mem[0];
|
||||
bind_info[i].memoryOffset = offset;
|
||||
|
||||
f->offset[i] = bind_info[i].memoryOffset;
|
||||
offset += cont_mem_size_list[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue