vulkan: move OPT_CHAIN out of hwcontext_vulkan

This allows for it to be shared.
Technically, implementations should not give drivers structs
that the drivers are not familiar with.
This commit is contained in:
Lynne 2025-04-20 10:57:42 +02:00
parent cee34e0a55
commit 96ddce1b3c
No known key found for this signature in database
GPG key ID: A2FEA5F03F034464
3 changed files with 64 additions and 84 deletions

View file

@ -349,6 +349,15 @@ static inline void ff_vk_link_struct(void *chain, const void *in)
out->pNext = (void *)in;
}
#define FF_VK_STRUCT_EXT(CTX, BASE, STRUCT_P, EXT_FLAG, TYPE) \
do { \
if ((EXT_FLAG == FF_VK_EXT_NO_FLAG) || \
((CTX)->extensions & EXT_FLAG)) { \
(STRUCT_P)->sType = TYPE; \
ff_vk_link_struct(BASE, STRUCT_P); \
} \
} while (0)
/* Identity mapping - r = r, b = b, g = g, a = a */
extern const VkComponentMapping ff_comp_identity_map;