headless: Fix build with up-to-date Vulkan headers
authorRosen Zhelev <rosen.zhelev@arm.com>
Sun, 28 Jun 2020 20:41:21 +0000 (21:41 +0100)
committerRosen Zhelev <rosen.zhelev@arm.com>
Mon, 29 Jun 2020 06:58:04 +0000 (07:58 +0100)
Vulkan Headers removed VK_FORMAT_RANGE_SIZE. The VkFormat enum now
has valid values in multiple ranges for different extensions.

Fixes headless implementation for itterating over core Vulkan 1.0
formats.

Change-Id: I417cfd881e479e5fb243c0b775600504af3877b1
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
wsi/headless/surface_properties.cpp

index b7136d79d1ee34ddf89cf48e1a03811de479063a..fecda614be9ecb5dc36b836fbe6acbfb24fb897a 100644 (file)
@@ -93,10 +93,11 @@ VkResult surface_properties::get_surface_formats(VkPhysicalDevice physical_devic
 
    VkResult res = VK_SUCCESS;
    /* Construct a list of all formats supported by the driver - for color attachment */
-   VkFormat formats[VK_FORMAT_RANGE_SIZE];
+   constexpr int max_core_1_0_formats = VK_FORMAT_ASTC_12x12_SRGB_BLOCK + 1;
+   VkFormat formats[max_core_1_0_formats];
    uint32_t format_count = 0;
 
-   for (int id = 0; id < VK_FORMAT_RANGE_SIZE; id++)
+   for (int id = 0; id < max_core_1_0_formats; id++)
    {
       VkImageFormatProperties image_format_props;