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

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

vulkan: Chain VkSwapchainImageCreateInfoANDROID structure

This allows the hal to see the swapchain image usage flags for
gralloc-backed images, in case it needs to do something special during
VkImage creation.

Change-Id: Ie3784ba4c7fdc08d4deace2f70b7f8879ba431fb
Test: build, run cube demo
parent 134d9580
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -639,12 +639,20 @@ VkResult CreateSwapchainKHR(VkDevice device,
    // -- Dequeue all buffers and create a VkImage for each --
    // Any failures during or after this must cancel the dequeued buffers.

    VkSwapchainImageCreateInfoANDROID swapchain_image_create = {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
        .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID,
#pragma clang diagnostic pop
        .pNext = nullptr,
        .usage = swapchain_image_usage,
    };
    VkNativeBufferANDROID image_native_buffer = {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
        .sType = VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID,
#pragma clang diagnostic pop
        .pNext = nullptr,
        .pNext = &swapchain_image_create,
    };
    VkImageCreateInfo image_create = {
        .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,