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

Commit fe2662d9 authored by Jesse Hall's avatar Jesse Hall
Browse files

libvulkan: Initialize VkSurfacePropertiesKHR::supportedCompositeAlpha

Also rearrange the code to set the fields of this struct in the same
order they appear in the struct, to make it easier to tell when
something is missing.

Bug: 26991609
Change-Id: I681ed42c96ac75bb1589d30ab75f760f660eacdd
parent c5cec281
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -238,18 +238,20 @@ VkResult GetPhysicalDeviceSurfaceCapabilitiesKHR_Bottom(
        return VK_ERROR_INITIALIZATION_FAILED;
    }

    capabilities->currentExtent =
        VkExtent2D{static_cast<uint32_t>(width), static_cast<uint32_t>(height)};

    // TODO(jessehall): Figure out what the min/max values should be.
    capabilities->minImageCount = 2;
    capabilities->maxImageCount = 3;

    capabilities->currentExtent =
        VkExtent2D{static_cast<uint32_t>(width), static_cast<uint32_t>(height)};

    // TODO(jessehall): Figure out what the max extent should be. Maximum
    // texture dimension maybe?
    capabilities->minImageExtent = VkExtent2D{1, 1};
    capabilities->maxImageExtent = VkExtent2D{4096, 4096};

    capabilities->maxImageArrayLayers = 1;

    // TODO(jessehall): We can support all transforms, fix this once
    // implemented.
    capabilities->supportedTransforms = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
@@ -257,7 +259,9 @@ VkResult GetPhysicalDeviceSurfaceCapabilitiesKHR_Bottom(
    // TODO(jessehall): Implement based on NATIVE_WINDOW_TRANSFORM_HINT.
    capabilities->currentTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;

    capabilities->maxImageArrayLayers = 1;
    // On Android, window composition is a WindowManager property, not something
    // associated with the bufferqueue. It can't be changed from here.
    capabilities->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR;

    // TODO(jessehall): I think these are right, but haven't thought hard about
    // it. Do we need to query the driver for support of any of these?