vulkan: use device properties 2 and add a convenience loader function
This commit is contained in:
parent
bf69a64135
commit
d386988c39
@ -108,6 +108,22 @@ const char *ff_vk_ret2str(VkResult res)
|
|||||||
#undef CASE
|
#undef CASE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ff_vk_load_props(FFVulkanContext *s)
|
||||||
|
{
|
||||||
|
FFVulkanFunctions *vk = &s->vkfn;
|
||||||
|
|
||||||
|
s->driver_props = (VkPhysicalDeviceDriverProperties) {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES,
|
||||||
|
};
|
||||||
|
s->props = (VkPhysicalDeviceProperties2) {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
|
||||||
|
.pNext = &s->driver_props,
|
||||||
|
};
|
||||||
|
|
||||||
|
vk->GetPhysicalDeviceProperties2(s->hwctx->phys_dev, &s->props);
|
||||||
|
vk->GetPhysicalDeviceMemoryProperties(s->hwctx->phys_dev, &s->mprops);
|
||||||
|
}
|
||||||
|
|
||||||
void ff_vk_qf_fill(FFVulkanContext *s)
|
void ff_vk_qf_fill(FFVulkanContext *s)
|
||||||
{
|
{
|
||||||
s->nb_qfs = 0;
|
s->nb_qfs = 0;
|
||||||
@ -189,7 +205,7 @@ int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req,
|
|||||||
|
|
||||||
/* Align if we need to */
|
/* Align if we need to */
|
||||||
if ((req_flags != UINT32_MAX) && 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);
|
req->size = FFALIGN(req->size, s->props.properties.limits.minMemoryMapAlignment);
|
||||||
|
|
||||||
alloc_info.allocationSize = req->size;
|
alloc_info.allocationSize = req->size;
|
||||||
|
|
||||||
|
@ -197,7 +197,8 @@ typedef struct FFVulkanContext {
|
|||||||
|
|
||||||
FFVulkanFunctions vkfn;
|
FFVulkanFunctions vkfn;
|
||||||
FFVulkanExtensions extensions;
|
FFVulkanExtensions extensions;
|
||||||
VkPhysicalDeviceProperties props;
|
VkPhysicalDeviceProperties2 props;
|
||||||
|
VkPhysicalDeviceDriverProperties driver_props;
|
||||||
VkPhysicalDeviceMemoryProperties mprops;
|
VkPhysicalDeviceMemoryProperties mprops;
|
||||||
|
|
||||||
AVBufferRef *device_ref;
|
AVBufferRef *device_ref;
|
||||||
@ -243,6 +244,11 @@ extern const VkComponentMapping ff_comp_identity_map;
|
|||||||
*/
|
*/
|
||||||
const char *ff_vk_ret2str(VkResult res);
|
const char *ff_vk_ret2str(VkResult res);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads props/mprops/driver_props
|
||||||
|
*/
|
||||||
|
void ff_vk_load_props(FFVulkanContext *s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns 1 if the image is any sort of supported RGB
|
* Returns 1 if the image is any sort of supported RGB
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user