Quoting Lynne (2023-04-24 17:56:38) > From 786a7d08bc90a88f77057fc31d0943dcb91e4558 Mon Sep 17 00:00:00 2001 > From: Lynne <d...@lynne.ee> > Date: Thu, 22 Dec 2022 17:37:51 +0100 > Subject: [PATCH 53/97] vulkan: add support for retrieving queue, query and > video properties > > --- > libavutil/vulkan.c | 87 ++++++++++++++++++++++++++++++------ > libavutil/vulkan.h | 14 ++++-- > libavutil/vulkan_functions.h | 1 + > 3 files changed, 85 insertions(+), 17 deletions(-) > > diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c > index de0c300c0e..d045ff83c1 100644 > --- a/libavutil/vulkan.c > +++ b/libavutil/vulkan.c > @@ -108,8 +108,9 @@ const char *ff_vk_ret2str(VkResult res) > #undef CASE > } > > -void ff_vk_load_props(FFVulkanContext *s) > +int ff_vk_load_props(FFVulkanContext *s) > { > + uint32_t qc = 0; > FFVulkanFunctions *vk = &s->vkfn; > > s->driver_props = (VkPhysicalDeviceDriverProperties) { > @@ -120,8 +121,48 @@ void ff_vk_load_props(FFVulkanContext *s) > .pNext = &s->driver_props, > }; > > + > vk->GetPhysicalDeviceProperties2(s->hwctx->phys_dev, &s->props); > vk->GetPhysicalDeviceMemoryProperties(s->hwctx->phys_dev, &s->mprops); > + vk->GetPhysicalDeviceQueueFamilyProperties2(s->hwctx->phys_dev, &qc, > s->qf_props); > + > + if (s->qf_props) > + return 0; > + > + s->qf_props = av_mallocz(sizeof(*s->qf_props)*qc);
av_calloc() Also, wouldn't it be better to allocate a single array of { qf_props; query_props; video_props; } > diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h > index 4bd1c9fc00..4c38dbc2e6 100644 > --- a/libavutil/vulkan.h > +++ b/libavutil/vulkan.h > @@ -216,6 +216,9 @@ typedef struct FFVulkanContext { > VkPhysicalDeviceProperties2 props; > VkPhysicalDeviceDriverProperties driver_props; > VkPhysicalDeviceMemoryProperties mprops; > + VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; > + VkQueueFamilyVideoPropertiesKHR *video_props; > + VkQueueFamilyProperties2 *qf_props; How does the user of these know how many elements are in each array? -- Anton Khirnov _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".