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

Commit e8361aef authored by Trevor Black's avatar Trevor Black Committed by Android (Google) Code Review
Browse files

Merge "Revert "Make BT709 support conditional on swapchain ext enable"" into tm-dev

parents 32d9f66b e91bd149
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -719,8 +719,6 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,

    bool wide_color_support = false;
    uint64_t consumer_usage = 0;
    bool swapchain_ext =
        instance_data.hook_extensions.test(ProcHook::EXT_swapchain_colorspace);
    if (surface_handle == VK_NULL_HANDLE) {
        ProcHook::Extension surfaceless = ProcHook::GOOGLE_surfaceless_query;
        bool surfaceless_enabled =
@@ -748,7 +746,9 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,

        consumer_usage = surface.consumer_usage;
    }
    wide_color_support = wide_color_support && swapchain_ext;
    wide_color_support =
        wide_color_support &&
        instance_data.hook_extensions.test(ProcHook::EXT_swapchain_colorspace);

    AHardwareBuffer_Desc desc = {};
    desc.width = 1;
@@ -760,12 +760,8 @@ 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}};

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

    if (wide_color_support) {
        all_formats.emplace_back(VkSurfaceFormatKHR{