mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
vulkan: support ignoring memory properties when allocating
This commit is contained in:
parent
3c2f43d8ee
commit
af48790465
@ -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…
x
Reference in New Issue
Block a user