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

Commit dcc3db7b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I7753858b,I7aebe80d

* changes:
  Allow PASS_THROUGH colorspace with R5G6B5, R16G16B16A16, A2B10G10R10
  Allow use of PASS_THROUGH colorspace with RGBA8
parents b03b65fb 52ac1e92
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -755,7 +755,11 @@ 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_SRGB, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR},
        // Also allow to use PASS_THROUGH + HAL_DATASPACE_ARBITRARY
        {VK_FORMAT_R8G8B8A8_UNORM, VK_COLOR_SPACE_PASS_THROUGH_EXT},
        {VK_FORMAT_R8G8B8A8_SRGB, VK_COLOR_SPACE_PASS_THROUGH_EXT},
    };

    if (colorspace_ext) {
        all_formats.emplace_back(VkSurfaceFormatKHR{
@@ -777,12 +781,16 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,
    if (AHardwareBuffer_isSupported(&desc)) {
        all_formats.emplace_back(VkSurfaceFormatKHR{
            VK_FORMAT_R5G6B5_UNORM_PACK16, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR});
        all_formats.emplace_back(VkSurfaceFormatKHR{
            VK_FORMAT_R5G6B5_UNORM_PACK16, VK_COLOR_SPACE_PASS_THROUGH_EXT});
    }

    desc.format = AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT;
    if (AHardwareBuffer_isSupported(&desc)) {
        all_formats.emplace_back(VkSurfaceFormatKHR{
            VK_FORMAT_R16G16B16A16_SFLOAT, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR});
        all_formats.emplace_back(VkSurfaceFormatKHR{
            VK_FORMAT_R16G16B16A16_SFLOAT, VK_COLOR_SPACE_PASS_THROUGH_EXT});
        if (wide_color_support) {
            all_formats.emplace_back(
                VkSurfaceFormatKHR{VK_FORMAT_R16G16B16A16_SFLOAT,
@@ -798,6 +806,9 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice pdev,
        all_formats.emplace_back(
            VkSurfaceFormatKHR{VK_FORMAT_A2B10G10R10_UNORM_PACK32,
                               VK_COLOR_SPACE_SRGB_NONLINEAR_KHR});
        all_formats.emplace_back(
            VkSurfaceFormatKHR{VK_FORMAT_A2B10G10R10_UNORM_PACK32,
                               VK_COLOR_SPACE_PASS_THROUGH_EXT});
        if (wide_color_support) {
            all_formats.emplace_back(
                VkSurfaceFormatKHR{VK_FORMAT_A2B10G10R10_UNORM_PACK32,