hwcontext_vulkan: guard all uses of new spec defines and fix stray bracket

This fixes compilation with less recent Vulkan headers.
This commit is contained in:
Lynne 2024-10-04 10:37:54 +02:00
parent a304cbeb8d
commit ac092c6707
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
2 changed files with 6 additions and 1 deletions

View File

@ -281,7 +281,10 @@ static void device_features_copy_needed(VulkanDeviceFeatures *dst, VulkanDeviceF
COPY_VAL(atomic_float.shaderBufferFloat32Atomics);
COPY_VAL(atomic_float.shaderBufferFloat32AtomicAdd);
#ifdef VK_KHR_shader_relaxed_extended_instruction
COPY_VAL(relaxed_extended_instruction.shaderRelaxedExtendedInstruction);
#endif
COPY_VAL(optical_flow.opticalFlow);
#undef COPY_VAL
@ -774,8 +777,8 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts,
err = AVERROR(EINVAL);
goto fail;
}
#endif
}
#endif
if (user_exts_str) {
char *save, *token = av_strtok(user_exts_str, "+", &save);

View File

@ -44,7 +44,9 @@ static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions,
{ VK_EXT_DEBUG_UTILS_EXTENSION_NAME, FF_VK_EXT_DEBUG_UTILS },
/* Device extensions */
#ifdef VK_KHR_shader_relaxed_extended_instruction
{ VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_EXTENSION_NAME, FF_VK_EXT_RELAXED_EXTENDED_INSTR },
#endif
{ VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_DMABUF_MEMORY },
{ VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME, FF_VK_EXT_DRM_MODIFIER_FLAGS },
{ VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_MEMORY },