diff --git a/scripts/generate_vk_helpers.py b/scripts/generate_vk_helpers.py index 1f066aab5..d94473e5f 100755 --- a/scripts/generate_vk_helpers.py +++ b/scripts/generate_vk_helpers.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2019-2021, Collabora, Ltd. +# Copyright 2019-2022, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 """Simple script to update vk_helpers.{c,h}.""" @@ -253,6 +253,7 @@ def get_instance_cmds(): # Sorted KHR, EXT, Vendor, interally alphabetically INSTANCE_EXTENSIONS_TO_CHECK = [ "VK_EXT_display_surface_counter", + "VK_EXT_swapchain_colorspace", ] # Sorted KHR, EXT, Vendor, interally alphabetically DEVICE_EXTENSIONS_TO_CHECK = [ diff --git a/src/xrt/auxiliary/vk/vk_bundle_init.c b/src/xrt/auxiliary/vk/vk_bundle_init.c index 1a334b79b..6c56080b8 100644 --- a/src/xrt/auxiliary/vk/vk_bundle_init.c +++ b/src/xrt/auxiliary/vk/vk_bundle_init.c @@ -127,6 +127,7 @@ vk_fill_in_has_instance_extensions(struct vk_bundle *vk, struct u_string_list *e // beginning of GENERATED instance extension code - do not modify - used by scripts // Reset before filling out. vk->has_EXT_display_surface_counter = false; + vk->has_EXT_swapchain_colorspace = false; const char *const *exts = u_string_list_get_data(ext_list); uint32_t ext_count = u_string_list_get_size(ext_list); @@ -140,6 +141,13 @@ vk_fill_in_has_instance_extensions(struct vk_bundle *vk, struct u_string_list *e continue; } #endif // defined(VK_EXT_display_surface_counter) + +#if defined(VK_EXT_swapchain_colorspace) + if (strcmp(ext, VK_EXT_SWAPCHAIN_COLORSPACE_EXTENSION_NAME) == 0) { + vk->has_EXT_swapchain_colorspace = true; + continue; + } +#endif // defined(VK_EXT_swapchain_colorspace) } // end of GENERATED instance extension code - do not modify - used by scripts } diff --git a/src/xrt/auxiliary/vk/vk_helpers.h b/src/xrt/auxiliary/vk/vk_helpers.h index 0ba2535b0..e12441568 100644 --- a/src/xrt/auxiliary/vk/vk_helpers.h +++ b/src/xrt/auxiliary/vk/vk_helpers.h @@ -115,6 +115,7 @@ struct vk_bundle // beginning of GENERATED instance extension code - do not modify - used by scripts bool has_EXT_display_surface_counter; + bool has_EXT_swapchain_colorspace; // end of GENERATED instance extension code - do not modify - used by scripts // beginning of GENERATED device extension code - do not modify - used by scripts diff --git a/src/xrt/include/xrt/xrt_vulkan_includes.h b/src/xrt/include/xrt/xrt_vulkan_includes.h index 317d1585b..1edcb4e97 100644 --- a/src/xrt/include/xrt/xrt_vulkan_includes.h +++ b/src/xrt/include/xrt/xrt_vulkan_includes.h @@ -30,6 +30,9 @@ #ifndef VK_KHR_MAINTENANCE_3_EXTENSION_NAME #define VK_KHR_MAINTENANCE_3_EXTENSION_NAME VK_KHR_MAINTENANCE3_EXTENSION_NAME #endif +#ifndef VK_EXT_SWAPCHAIN_COLORSPACE_EXTENSION_NAME +#define VK_EXT_SWAPCHAIN_COLORSPACE_EXTENSION_NAME VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME +#endif #if defined(VK_USE_PLATFORM_XLIB_XRANDR_EXT) || defined(VK_USE_PLATFORM_XLIB_KHR) // the xlib header is notoriously polluting.