diff --git a/server/driver/wivrn_comp_target.cpp b/server/driver/wivrn_comp_target.cpp index b529e359..46a0be4e 100644 --- a/server/driver/wivrn_comp_target.cpp +++ b/server/driver/wivrn_comp_target.cpp @@ -483,20 +483,6 @@ static void comp_wivrn_present_thread(std::stop_token stop_token, wivrn_comp_tar auto res = vk.device.waitForFences(*cn->psc.fence, true, UINT64_MAX); - // Update encoder status, release image - if ((cn->psc.status &= ~status_bit) == 0) - { - cn->psc.status.notify_all(); - for (auto & img: cn->psc.images) - { - if (img.status == pseudo_swapchain::status_t::encoding) - { - img.status = pseudo_swapchain::status_t::free; - break; - } - } - } - try { for (auto & encoder: encoders) @@ -513,6 +499,20 @@ static void comp_wivrn_present_thread(std::stop_token stop_token, wivrn_comp_tar { // Ignore errors } + + // Update encoder status, release image + if ((cn->psc.status &= ~status_bit) == 0) + { + cn->psc.status.notify_all(); + for (auto & img: cn->psc.images) + { + if (img.status == pseudo_swapchain::status_t::encoding) + { + img.status = pseudo_swapchain::status_t::free; + break; + } + } + } } }