diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py index 64e7a34f6..d3fa062aa 100755 --- a/scripts/generate_vk_helpers.py +++ b/scripts/generate_vk_helpers.py @@ -167,6 +167,8 @@ def get_device_cmds(): Cmd("vkGetSwapchainCounterEXT", requires=("VK_EXT_display_control",)), Cmd("vkRegisterDeviceEventEXT", requires=("VK_EXT_display_control",)), Cmd("vkRegisterDisplayEventEXT", requires=("VK_EXT_display_control",)), + None, + Cmd("vkGetImageDrmFormatModifierPropertiesEXT", requires=("VK_EXT_image_drm_format_modifier",)), ] @@ -191,6 +193,7 @@ def get_instance_cmds(): Cmd("vkGetPhysicalDeviceSurfacePresentModesKHR"), Cmd("vkGetPhysicalDeviceSurfaceSupportKHR"), Cmd("vkGetPhysicalDeviceFormatProperties"), + Cmd("vkGetPhysicalDeviceFormatProperties2KHR", member_name="vkGetPhysicalDeviceFormatProperties2"), Cmd("vkGetPhysicalDeviceImageFormatProperties2"), Cmd("vkGetPhysicalDeviceExternalBufferPropertiesKHR"), Cmd("vkGetPhysicalDeviceExternalFencePropertiesKHR"), @@ -243,7 +246,7 @@ def get_instance_cmds(): None, Cmd("vkCreateWin32SurfaceKHR", requires=("VK_USE_PLATFORM_WIN32_KHR",)), None, - Cmd("vkGetPhysicalDeviceSurfaceCapabilities2EXT", requires=("VK_EXT_display_surface_counter",)) + Cmd("vkGetPhysicalDeviceSurfaceCapabilities2EXT", requires=("VK_EXT_display_surface_counter",)), ] @@ -264,7 +267,9 @@ DEVICE_EXTENSIONS_TO_CHECK = [ "VK_KHR_timeline_semaphore", "VK_EXT_calibrated_timestamps", "VK_EXT_display_control", + "VK_EXT_external_memory_dma_buf", "VK_EXT_global_priority", + "VK_EXT_image_drm_format_modifier", "VK_EXT_robustness2", "VK_GOOGLE_display_timing", ] diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c index 2518a3a90..3b3b7b721 100644 --- a/src/xrt/auxiliary/vk/vk_bundle_init.c +++ b/src/xrt/auxiliary/vk/vk_bundle_init.c @@ -614,7 +614,9 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li vk->has_KHR_timeline_semaphore = false; vk->has_EXT_calibrated_timestamps = false; vk->has_EXT_display_control = false; + vk->has_EXT_external_memory_dma_buf = false; vk->has_EXT_global_priority = false; + vk->has_EXT_image_drm_format_modifier = false; vk->has_EXT_robustness2 = false; vk->has_GOOGLE_display_timing = false; @@ -701,6 +703,13 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li } #endif // defined(VK_EXT_display_control) +#if defined(VK_EXT_external_memory_dma_buf) + if (strcmp(ext, VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME) == 0) { + vk->has_EXT_external_memory_dma_buf = true; + continue; + } +#endif // defined(VK_EXT_external_memory_dma_buf) + #if defined(VK_EXT_global_priority) if (strcmp(ext, VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME) == 0) { vk->has_EXT_global_priority = true; @@ -708,6 +717,13 @@ fill_in_has_device_extensions(struct vk_bundle *vk, struct u_string_list *ext_li } #endif // defined(VK_EXT_global_priority) +#if defined(VK_EXT_image_drm_format_modifier) + if (strcmp(ext, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME) == 0) { + vk->has_EXT_image_drm_format_modifier = true; + continue; + } +#endif // defined(VK_EXT_image_drm_format_modifier) + #if defined(VK_EXT_robustness2) if (strcmp(ext, VK_EXT_ROBUSTNESS_2_EXTENSION_NAME) == 0) { vk->has_EXT_robustness2 = true; diff --git a/src/xrt/auxiliary/vk/vk_function_loaders.c b/src/xrt/auxiliary/vk/vk_function_loaders.c index 38e79073a..63f689d27 100644 --- a/src/xrt/auxiliary/vk/vk_function_loaders.c +++ b/src/xrt/auxiliary/vk/vk_function_loaders.c @@ -77,6 +77,7 @@ vk_get_instance_functions(struct vk_bundle *vk) vk->vkGetPhysicalDeviceSurfacePresentModesKHR = GET_INS_PROC(vk, vkGetPhysicalDeviceSurfacePresentModesKHR); vk->vkGetPhysicalDeviceSurfaceSupportKHR = GET_INS_PROC(vk, vkGetPhysicalDeviceSurfaceSupportKHR); vk->vkGetPhysicalDeviceFormatProperties = GET_INS_PROC(vk, vkGetPhysicalDeviceFormatProperties); + vk->vkGetPhysicalDeviceFormatProperties2 = GET_INS_PROC(vk, vkGetPhysicalDeviceFormatProperties2KHR); vk->vkGetPhysicalDeviceImageFormatProperties2 = GET_INS_PROC(vk, vkGetPhysicalDeviceImageFormatProperties2); vk->vkGetPhysicalDeviceExternalBufferPropertiesKHR = GET_INS_PROC(vk, vkGetPhysicalDeviceExternalBufferPropertiesKHR); vk->vkGetPhysicalDeviceExternalFencePropertiesKHR = GET_INS_PROC(vk, vkGetPhysicalDeviceExternalFencePropertiesKHR); @@ -300,8 +301,13 @@ vk_get_device_functions(struct vk_bundle *vk) vk->vkGetSwapchainCounterEXT = GET_DEV_PROC(vk, vkGetSwapchainCounterEXT); vk->vkRegisterDeviceEventEXT = GET_DEV_PROC(vk, vkRegisterDeviceEventEXT); vk->vkRegisterDisplayEventEXT = GET_DEV_PROC(vk, vkRegisterDisplayEventEXT); + #endif // defined(VK_EXT_display_control) +#if defined(VK_EXT_image_drm_format_modifier) + vk->vkGetImageDrmFormatModifierPropertiesEXT = GET_DEV_PROC(vk, vkGetImageDrmFormatModifierPropertiesEXT); +#endif // defined(VK_EXT_image_drm_format_modifier) + // end of GENERATED device loader code - do not modify - used by scripts // clang-format on return VK_SUCCESS; diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index dac664aba..7f0f63c7e 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -128,7 +128,9 @@ struct vk_bundle bool has_KHR_timeline_semaphore; bool has_EXT_calibrated_timestamps; bool has_EXT_display_control; + bool has_EXT_external_memory_dma_buf; bool has_EXT_global_priority; + bool has_EXT_image_drm_format_modifier; bool has_EXT_robustness2; bool has_GOOGLE_display_timing; // end of GENERATED device extension code - do not modify - used by scripts @@ -191,6 +193,7 @@ struct vk_bundle PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR; PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties; + PFN_vkGetPhysicalDeviceFormatProperties2KHR vkGetPhysicalDeviceFormatProperties2; PFN_vkGetPhysicalDeviceImageFormatProperties2 vkGetPhysicalDeviceImageFormatProperties2; PFN_vkGetPhysicalDeviceExternalBufferPropertiesKHR vkGetPhysicalDeviceExternalBufferPropertiesKHR; PFN_vkGetPhysicalDeviceExternalFencePropertiesKHR vkGetPhysicalDeviceExternalFencePropertiesKHR; @@ -405,8 +408,13 @@ struct vk_bundle PFN_vkGetSwapchainCounterEXT vkGetSwapchainCounterEXT; PFN_vkRegisterDeviceEventEXT vkRegisterDeviceEventEXT; PFN_vkRegisterDisplayEventEXT vkRegisterDisplayEventEXT; + #endif // defined(VK_EXT_display_control) +#if defined(VK_EXT_image_drm_format_modifier) + PFN_vkGetImageDrmFormatModifierPropertiesEXT vkGetImageDrmFormatModifierPropertiesEXT; +#endif // defined(VK_EXT_image_drm_format_modifier) + // end of GENERATED device loader code - do not modify - used by scripts };