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

Commit ea5745af authored by Trevor David Black's avatar Trevor David Black
Browse files

Make BT709 support conditional on swapchain ext enable

Bug: 203533233
Test: build
Change-Id: I5f36059a06a92216bc83e3e794f7992ea3ce8048
parent fbfa5722
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{