st/oxr: Slightly improve swapchain image status

The current code is not up spec at all anyways, but this at least
helps to avoid some bad situations in the current code.
This commit is contained in:
Jakob Bornecrantz 2019-06-28 16:03:31 +01:00
parent 79364eaf4c
commit 97939accda

View file

@ -38,6 +38,13 @@ oxr_swapchain_acquire_image(struct oxr_logger *log,
}
sc->acquired_index = (int)index;
// If the compositor is resuing the image,
// mark it as invalid to use in xrEndFrame.
if (sc->released_index == (int)index) {
sc->released_index = -1;
}
*out_index = index;
return XR_SUCCESS;
@ -78,6 +85,8 @@ oxr_swapchain_release_image(struct oxr_logger *log,
return oxr_error(log, XR_ERROR_RUNTIME_FAILURE,
" call to xsc->release_image failed");
}
// Overwrite the old released image, with new.
sc->released_index = sc->acquired_index;
sc->acquired_index = -1;