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

Commit fe330695 authored by Trevor Black's avatar Trevor Black Committed by Automerger Merge Worker
Browse files

Merge "Add conditional BT709 support to the vulkan swapchain" am: cba1c577...

Merge "Add conditional BT709 support to the vulkan swapchain" am: cba1c577 am: 3365990b am: 0cbebac3 am: ce3385d2

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2021396

Change-Id: I5cdbfabca39923178ba2202106321a7f30581276
parents ed29f25b ce3385d2
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -719,7 +719,7 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,

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

        consumer_usage = surface.consumer_usage;
    }
    wide_color_support = wide_color_support && swapchain_ext;
    wide_color_support = wide_color_support && colorspace_ext;

    AHardwareBuffer_Desc desc = {};
    desc.width = 1;
@@ -762,6 +762,11 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,
        {VK_FORMAT_R8G8B8A8_UNORM, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR},
        {VK_FORMAT_R8G8B8A8_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR}};

    if (colorspace_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{
            VK_FORMAT_R8G8B8A8_UNORM, VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT});