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

Commit b4eb278b authored by Chris Forbes's avatar Chris Forbes
Browse files

vulkan: Implement V7 of ANDROID_native_buffer in nulldrv

Walks the struct chain in GPDP2, and claims support for shared
presentable image. This is enough to have libvulkan expose the
extension for us.

Change-Id: Id22593932cd567e79d18aae788935148d6278b3f
Test: setprop ro.hardware.vulkan default, observe extension exposed
parent ff4bc528
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
@@ -513,6 +513,28 @@ void GetPhysicalDeviceProperties(VkPhysicalDevice,
void GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physical_device,
void GetPhysicalDeviceProperties2KHR(VkPhysicalDevice physical_device,
                                  VkPhysicalDeviceProperties2KHR* properties) {
                                  VkPhysicalDeviceProperties2KHR* properties) {
    GetPhysicalDeviceProperties(physical_device, &properties->properties);
    GetPhysicalDeviceProperties(physical_device, &properties->properties);

    while (properties->pNext) {
        properties = reinterpret_cast<VkPhysicalDeviceProperties2KHR *>(properties->pNext);

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
        switch ((VkFlags)properties->sType) {
        case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID: {
            VkPhysicalDevicePresentationPropertiesANDROID *presentation_properties =
                reinterpret_cast<VkPhysicalDevicePresentationPropertiesANDROID *>(properties);
#pragma clang diagnostic pop

                // Claim that we do all the right things for the loader to
                // expose KHR_shared_presentable_image on our behalf.
                presentation_properties->sharedImage = VK_TRUE;
            } break;

        default:
            // Silently ignore other extension query structs
            break;
        }
    }
}
}


void GetPhysicalDeviceQueueFamilyProperties(
void GetPhysicalDeviceQueueFamilyProperties(