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

Commit 39c7b9a9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Inline GetPhysicalDeviceProperties2 into QueryPresentationProperties"...

Merge "Inline GetPhysicalDeviceProperties2 into QueryPresentationProperties" am: 55adcd04 am: 5afc138a am: 3b2a34f8

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1934298

Change-Id: I881b1f8c1b463856d38680a5e96aca2385fe8a67
parents dd820bdc 3b2a34f8
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -979,6 +979,8 @@ VkResult EnumerateInstanceExtensionProperties(
void QueryPresentationProperties(
    VkPhysicalDevice physicalDevice,
    VkPhysicalDevicePresentationPropertiesANDROID* presentation_properties) {
    ATRACE_CALL();

    // Request the android-specific presentation properties via GPDP2
    VkPhysicalDeviceProperties2 properties = {
        VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2,
@@ -994,7 +996,17 @@ void QueryPresentationProperties(
    presentation_properties->pNext = nullptr;
    presentation_properties->sharedImage = VK_FALSE;

    GetPhysicalDeviceProperties2(physicalDevice, &properties);
    const auto& driver = GetData(physicalDevice).driver;

    if (driver.GetPhysicalDeviceProperties2) {
        // >= 1.1 driver, supports core GPDP2 entrypoint.
        driver.GetPhysicalDeviceProperties2(physicalDevice, &properties);
    } else if (driver.GetPhysicalDeviceProperties2KHR) {
        // Old driver, but may support presentation properties
        // if we have the GPDP2 extension. Otherwise, no presentation
        // properties supported.
        driver.GetPhysicalDeviceProperties2KHR(physicalDevice, &properties);
    }
}

VkResult EnumerateDeviceExtensionProperties(