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

Commit eef9225b authored by Jesse Hall's avatar Jesse Hall Committed by android-build-merger
Browse files

Merge "libvulkan: Fix count returned for incomplete wsi queries" am:...

Merge "libvulkan: Fix count returned for incomplete wsi queries" am: 75bb94fe am: f4171ecd am: 7f3fdaa0
am: ebe91de2

Change-Id: If131abf6f3bf0c35832dab458cfc17b315944970
parents 1bd88fc3 ebe91de2
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -361,9 +361,11 @@ VkResult GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice /*pdev*/,
    if (formats) {
        if (*count < kNumFormats)
            result = VK_INCOMPLETE;
        std::copy(kFormats, kFormats + std::min(*count, kNumFormats), formats);
    }
        *count = std::min(*count, kNumFormats);
        std::copy(kFormats, kFormats + *count, formats);
    } else {
        *count = kNumFormats;
    }
    return result;
}

@@ -381,9 +383,11 @@ VkResult GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice /*pdev*/,
    if (modes) {
        if (*count < kNumModes)
            result = VK_INCOMPLETE;
        std::copy(kModes, kModes + std::min(*count, kNumModes), modes);
    }
        *count = std::min(*count, kNumModes);
        std::copy(kModes, kModes + *count, modes);
    } else {
        *count = kNumModes;
    }
    return result;
}

@@ -751,8 +755,10 @@ VkResult GetSwapchainImagesKHR(VkDevice,
        }
        for (uint32_t i = 0; i < n; i++)
            images[i] = swapchain.images[i].image;
    }
        *count = n;
    } else {
        *count = swapchain.num_images;
    }
    return result;
}