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

Commit a9e06fd4 authored by Ian Elliott's avatar Ian Elliott
Browse files

swapchain: Implement VK_KHR_surface_protected_capabilities

Bug: 221490496
Test: Test with ANGLE EGLConfig-generation code
Change-Id: Id01e677175a2cf98f4d893e21f3c654375772153
Merged-In: Id01e677175a2cf98f4d893e21f3c654375772153
parent 8e0f1216
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -624,6 +624,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
        switch (ext_bit) {
            case ProcHook::KHR_android_surface:
            case ProcHook::KHR_surface:
            case ProcHook::KHR_surface_protected_capabilities:
            case ProcHook::EXT_swapchain_colorspace:
            case ProcHook::KHR_get_surface_capabilities2:
            case ProcHook::GOOGLE_surfaceless_query:
@@ -702,6 +703,7 @@ void CreateInfoWrapper::FilterExtension(const char* name) {
            case ProcHook::KHR_external_fence_capabilities:
            case ProcHook::KHR_get_surface_capabilities2:
            case ProcHook::KHR_surface:
            case ProcHook::KHR_surface_protected_capabilities:
            case ProcHook::EXT_debug_report:
            case ProcHook::EXT_swapchain_colorspace:
            case ProcHook::GOOGLE_surfaceless_query:
@@ -915,6 +917,9 @@ VkResult EnumerateInstanceExtensionProperties(
    loader_extensions.push_back({
        VK_KHR_SURFACE_EXTENSION_NAME,
        VK_KHR_SURFACE_SPEC_VERSION});
    loader_extensions.push_back(
        {VK_KHR_SURFACE_PROTECTED_CAPABILITIES_EXTENSION_NAME,
         VK_KHR_SURFACE_PROTECTED_CAPABILITIES_SPEC_VERSION});
    loader_extensions.push_back({
        VK_KHR_ANDROID_SURFACE_EXTENSION_NAME,
        VK_KHR_ANDROID_SURFACE_SPEC_VERSION});
+1 −0
Original line number Diff line number Diff line
@@ -571,6 +571,7 @@ ProcHook::Extension GetProcHookExtension(const char* name) {
    if (strcmp(name, "VK_KHR_incremental_present") == 0) return ProcHook::KHR_incremental_present;
    if (strcmp(name, "VK_KHR_shared_presentable_image") == 0) return ProcHook::KHR_shared_presentable_image;
    if (strcmp(name, "VK_KHR_surface") == 0) return ProcHook::KHR_surface;
    if (strcmp(name, "VK_KHR_surface_protected_capabilities") == 0) return ProcHook::KHR_surface_protected_capabilities;
    if (strcmp(name, "VK_KHR_swapchain") == 0) return ProcHook::KHR_swapchain;
    if (strcmp(name, "VK_ANDROID_external_memory_android_hardware_buffer") == 0) return ProcHook::ANDROID_external_memory_android_hardware_buffer;
    if (strcmp(name, "VK_KHR_bind_memory2") == 0) return ProcHook::KHR_bind_memory2;
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ struct ProcHook {
        KHR_incremental_present,
        KHR_shared_presentable_image,
        KHR_surface,
        KHR_surface_protected_capabilities,
        KHR_swapchain,
        ANDROID_external_memory_android_hardware_buffer,
        KHR_bind_memory2,
+6 −0
Original line number Diff line number Diff line
@@ -848,6 +848,12 @@ VkResult GetPhysicalDeviceSurfaceCapabilities2KHR(
                        .supportedUsageFlags;
            } break;

            case VK_STRUCTURE_TYPE_SURFACE_PROTECTED_CAPABILITIES_KHR: {
                VkSurfaceProtectedCapabilitiesKHR* protected_caps =
                    reinterpret_cast<VkSurfaceProtectedCapabilitiesKHR*>(caps);
                protected_caps->supportsProtected = VK_TRUE;
            } break;

            default:
                // Ignore all other extension structs
                break;
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ _INTERCEPTED_EXTENSIONS = [
    'VK_KHR_incremental_present',
    'VK_KHR_shared_presentable_image',
    'VK_KHR_surface',
    'VK_KHR_surface_protected_capabilities',
    'VK_KHR_swapchain',
]