Commit 97939acc authored by Jakob Bornecrantz's avatar Jakob Bornecrantz
Browse files

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.
parent 79364eaf
......@@ -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;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment