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

Commit 49815200 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make BT709 support conditional on swapchain ext enable"

parents ece78e25 ea5745af
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -720,10 +720,10 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,
    if (err) {
        return VK_ERROR_SURFACE_LOST_KHR;
    }
    ALOGV("wide_color_support is: %d", wide_color_support);
    wide_color_support =
        wide_color_support &&
    bool swapchain_ext =
        instance_data.hook_extensions.test(ProcHook::EXT_swapchain_colorspace);
    ALOGV("wide_color_support is: %d", wide_color_support);
    wide_color_support = wide_color_support && swapchain_ext;

    AHardwareBuffer_Desc desc = {};
    desc.width = 1;
@@ -736,8 +736,12 @@ 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_UNORM, VK_COLOR_SPACE_BT709_LINEAR_EXT}};
        {VK_FORMAT_R8G8B8A8_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR}};

    if (swapchain_ext) {
        all_formats.emplace_back(VkSurfaceFormatKHR{
            VK_FORMAT_R8G8B8A8_UNORM, VK_COLOR_SPACE_BT709_LINEAR_EXT});
    }

    if (wide_color_support) {
        all_formats.emplace_back(VkSurfaceFormatKHR{