aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2022-11-29 00:43:19 +0000
committerLynne <dev@lynne.ee>2023-05-29 00:41:45 +0200
commitaf487904655ca45824fb4198b5ddfc00c906897a (patch)
treee5987d3a494d4da7aa06325d04a291a0ea5ef05c
parent3c2f43d8eef0c181a002cb87f1c65b1c419ba1e4 (diff)
downloadffmpeg-af487904655ca45824fb4198b5ddfc00c906897a.tar.gz
vulkan: support ignoring memory properties when allocating
-rw-r--r--libavutil/vulkan.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 7870de351d..b1553c6537 100644
--- a/libavutil/vulkan.c
+++ b/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);
}