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

Commit c42eae52 authored by Lingfeng Yang's avatar Lingfeng Yang
Browse files

Allow use of PASS_THROUGH colorspace with RGBA8

This CL allows us to specify the pass through color space,
and as a consequence, HAL_DATASPACE_ARBITRARY, on swapchain creation.

This helps us pass Media encode/decode test cases on ANGLE.

Bug: 237512291
Change-Id: I7aebe80d77fdc454f04489fbc552bad40a922ae3
parent f1a229ca
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -763,7 +763,11 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,
    // We must support R8G8B8A8
    std::vector<VkSurfaceFormatKHR> all_formats = {
        {VK_FORMAT_R8G8B8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR},
        {VK_FORMAT_R8G8B8A8_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR}};
        {VK_FORMAT_R8G8B8A8_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR},
        // Also allow to use PASS_THROUGH + HAL_DATASPACE_ARBITRARY
        {VK_FORMAT_R8G8B8A8_UNORM, VK_COLOR_SPACE_PASS_THROUGH_EXT},
        {VK_FORMAT_R8G8B8A8_SRGB, VK_COLOR_SPACE_PASS_THROUGH_EXT},
    };

    if (colorspace_ext) {
        all_formats.emplace_back(VkSurfaceFormatKHR{