vulkan: support ignoring memory properties when allocating

pull/389/head
Lynne 2 years ago
parent 3c2f43d8ee
commit af48790465
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
  1. 7
      libavutil/vulkan.c

@ -188,7 +188,7 @@ int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
};
/* Align if we need to */
if (req_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
if ((req_flags != UINT32_MAX) && req_flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
req->size = FFALIGN(req->size, s->props.limits.minMemoryMapAlignment);
alloc_info.allocationSize = req->size;
@ -201,7 +201,8 @@ int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
continue;
/* The memory type flags must include our properties */
if ((s->mprops.memoryTypes[i].propertyFlags & req_flags) != req_flags)
if ((req_flags != UINT32_MAX) &&
((s->mprops.memoryTypes[i].propertyFlags & req_flags) != req_flags))
continue;
/* Found a suitable memory type */
@ -210,7 +211,7 @@ int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
}
if (index < 0) {
av_log(s, AV_LOG_ERROR, "No memory type found for flags 0x%x\n",
av_log(s->device, AV_LOG_ERROR, "No memory type found for flags 0x%x\n",
req_flags);
return AVERROR(EINVAL);
}

Loading…
Cancel
Save