for (int i = 0; i < planes; i++) {
int h = src->height;
int p_height = i > 0 ? AV_CEIL_RSHIFT(h, log2_chroma) : h;
- size_t p_size = FFABS(src->linesize[i]) * p_height;
+ size_t p_size = FFALIGN(FFABS(src->linesize[i]) * p_height,
+ p->hprops.minImportedHostPointerAlignment);
VkImportMemoryHostPointerInfoEXT import_desc = {
.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT,
/* We can only map images with positive stride and alignment appropriate
* for the device. */
host_mapped[i] = map_host && src->linesize[i] > 0 &&
- !(p_size % p->hprops.minImportedHostPointerAlignment) &&
!(((uintptr_t)import_desc.pHostPointer) %
p->hprops.minImportedHostPointerAlignment);
p_size = host_mapped[i] ? p_size : 0;
for (int i = 0; i < planes; i++) {
int h = dst->height;
int p_height = i > 0 ? AV_CEIL_RSHIFT(h, log2_chroma) : h;
- size_t p_size = FFABS(dst->linesize[i]) * p_height;
+ size_t p_size = FFALIGN(FFABS(dst->linesize[i]) * p_height,
+ p->hprops.minImportedHostPointerAlignment);
VkImportMemoryHostPointerInfoEXT import_desc = {
.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT,
/* We can only map images with positive stride and alignment appropriate
* for the device. */
host_mapped[i] = map_host && dst->linesize[i] > 0 &&
- !(p_size % p->hprops.minImportedHostPointerAlignment) &&
!(((uintptr_t)import_desc.pHostPointer) %
p->hprops.minImportedHostPointerAlignment);
p_size = host_mapped[i] ? p_size : 0;