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

Commit e4f0f736 authored by Trevor Black's avatar Trevor Black Committed by Trevor David Black
Browse files

Revert "Make BT709 support conditional on swapchain ext enable"

This reverts commit ea5745af.

Reason for revert: Need to land in aosp

Change-Id: Id056873193a711de140acb2f1dfd4a734ecaec4b
parent 0227cccb
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{