wsi: Track CPU side present ordering via a serial

We will use this in our hueristics to pick the most optimal buffer in AcquireNextImageKHR

Signed-off-by: Joshua Ashton <joshua@froggi.es>

Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Reviewed-by: Erik Kurzinger <ekurzinger@nvidia.com>
Reviewed-by: Sebastian Wick <sebastian.wick@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25709>
This commit is contained in:
Joshua Ashton
2024-03-21 18:13:52 +00:00
committed by Marge Bot
parent 7467f29af1
commit 6a72ea01d3
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -1472,6 +1472,7 @@ wsi_common_queue_present(const struct wsi_device *wsi,
/* The app can only submit images they have acquired. */
assert(image->acquired);
image->acquired = false;
image->present_serial = ++swapchain->present_serial;
#ifdef HAVE_LIBDRM
if (has_signal_dma_buf) {
+3
View File
@@ -134,6 +134,7 @@ struct wsi_image {
* on the CPU side via acquire_next_image.
*/
bool acquired;
uint64_t present_serial;
#ifndef _WIN32
uint64_t drm_modifier;
@@ -164,6 +165,8 @@ struct wsi_swapchain {
struct wsi_image_info image_info;
uint32_t image_count;
uint64_t present_serial;
struct {
enum wsi_swapchain_blit_type type;