aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/vulkan.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2025-05-18 13:52:46 +0200
committerNiklas Haas <git@haasn.dev>2025-05-28 12:21:20 +0200
commit0a4cdf8822e7388ca0930d71ac3cf90c9f2f9446 (patch)
treec7aa7db273ee9b540e6b6a22668d1f5fed410f08 /libavutil/vulkan.c
parentc2521c0cd2d3b590db8998e62c14edb4df059942 (diff)
downloadffmpeg-0a4cdf8822e7388ca0930d71ac3cf90c9f2f9446.tar.gz
avutil/vulkan: automatically enable shader device address usage bit
We require this internally when using descriptor buffers, so it makes sense to enable it internally, also.
Diffstat (limited to 'libavutil/vulkan.c')
-rw-r--r--libavutil/vulkan.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 5f2ac6267d..a989e080ab 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -989,6 +989,16 @@ int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size,
int use_ded_mem;
FFVulkanFunctions *vk = &s->vkfn;
+ /* Buffer usage flags corresponding to buffer descriptor types */
+ const VkBufferUsageFlags desc_usage =
+ VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT |
+ VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
+ VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT |
+ VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT;
+
+ if ((s->extensions & FF_VK_EXT_DESCRIPTOR_BUFFER) && (usage & desc_usage))
+ usage |= VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT;
+
VkBufferCreateInfo buf_spawn = {
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.pNext = pNext,