Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34a327b7 authored by Ian Elliott's avatar Ian Elliott Committed by Chris Forbes
Browse files

Temporarily disable 2 unratified Khronos extensions.

Test: Ran the following CTS test cases, which now say "NotSupported":
dEQP-VK.wsi.android.surface.query_capabilities2
dEQP-VK.wsi.android.surface.query_formats2
dEQP-VK.wsi.android.shared_presentable_image.scale_none.demand
dEQP-VK.wsi.android.shared_presentable_image.scale_none.continuous
dEQP-VK.wsi.android.shared_presentable_image.scale_up.demand
dEQP-VK.wsi.android.shared_presentable_image.scale_up.continuous
dEQP-VK.wsi.android.shared_presentable_image.scale_down.demand
dEQP-VK.wsi.android.shared_presentable_image.scale_down.continuous

Disable the Khronos/Vulkan VK_KHR_get_surface_capabilities2 and
VK_KHR_shared_presentable_image extensions until the May 5th
ratification of these two extensions.  A macro/ifdef's are used to allow
easy enablement of the extensions for internal testing and bug fixes.

V2: convert preprocessor flag to constant [chrisforbes]

Change-Id: Ic41360e42561a822d51e1d7fc3172c76c12e5bde
parent 91cfa880
Loading
Loading
Loading
Loading
+30 −17
Original line number Original line Diff line number Diff line
@@ -34,6 +34,9 @@
#include "driver.h"
#include "driver.h"
#include "stubhal.h"
#include "stubhal.h"


// Set to true to enable exposing unratified extensions for development
static const bool kEnableUnratifiedExtensions = false;

// #define ENABLE_ALLOC_CALLSTACKS 1
// #define ENABLE_ALLOC_CALLSTACKS 1
#if ENABLE_ALLOC_CALLSTACKS
#if ENABLE_ALLOC_CALLSTACKS
#include <utils/CallStack.h>
#include <utils/CallStack.h>
@@ -675,16 +678,24 @@ VkResult EnumerateInstanceExtensionProperties(
    const char* pLayerName,
    const char* pLayerName,
    uint32_t* pPropertyCount,
    uint32_t* pPropertyCount,
    VkExtensionProperties* pProperties) {
    VkExtensionProperties* pProperties) {
    static const std::array<VkExtensionProperties, 4> loader_extensions = {{

        // WSI extensions
    android::Vector<VkExtensionProperties> loader_extensions;
        {VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_SURFACE_SPEC_VERSION},
    loader_extensions.push_back({
        {VK_KHR_ANDROID_SURFACE_EXTENSION_NAME,
        VK_KHR_SURFACE_EXTENSION_NAME,
         VK_KHR_ANDROID_SURFACE_SPEC_VERSION},
        VK_KHR_SURFACE_SPEC_VERSION});
        {VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME,
    loader_extensions.push_back({
         VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION},
        VK_KHR_ANDROID_SURFACE_EXTENSION_NAME,
        {VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME,
        VK_KHR_ANDROID_SURFACE_SPEC_VERSION});
         VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION},
    loader_extensions.push_back({
    }};
        VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME,
        VK_EXT_SWAPCHAIN_COLOR_SPACE_SPEC_VERSION});

    if (kEnableUnratifiedExtensions) {
        loader_extensions.push_back({
            VK_KHR_GET_SURFACE_CAPABILITIES_2_EXTENSION_NAME,
            VK_KHR_GET_SURFACE_CAPABILITIES_2_SPEC_VERSION});
    }

    static const VkExtensionProperties loader_debug_report_extension = {
    static const VkExtensionProperties loader_debug_report_extension = {
        VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION,
        VK_EXT_DEBUG_REPORT_EXTENSION_NAME, VK_EXT_DEBUG_REPORT_SPEC_VERSION,
    };
    };
@@ -782,6 +793,7 @@ VkResult EnumerateDeviceExtensionProperties(
        VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME,
        VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME,
        VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION});
        VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION});


    if (kEnableUnratifiedExtensions) {
        // conditionally add shared_presentable_image if supportable
        // conditionally add shared_presentable_image if supportable
        VkPhysicalDevicePresentationPropertiesANDROID presentation_properties;
        VkPhysicalDevicePresentationPropertiesANDROID presentation_properties;
        if (QueryPresentationProperties(physicalDevice, &presentation_properties) &&
        if (QueryPresentationProperties(physicalDevice, &presentation_properties) &&
@@ -790,6 +802,7 @@ VkResult EnumerateDeviceExtensionProperties(
                VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME,
                VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME,
                        VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION});
                        VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION});
        }
        }
    }


    // enumerate our extensions first
    // enumerate our extensions first
    if (!pLayerName && pProperties) {
    if (!pLayerName && pProperties) {