Release swapchain earlier
Encoders now have a buffer for next image so that they can encode one and the compositor write to an other one.
This commit is contained in:
@@ -391,23 +391,11 @@ 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);
|
||||
// Get local copies before releasing the image
|
||||
auto view_info = cn->psc.view_info;
|
||||
auto frame_index = cn->psc.frame_index;
|
||||
|
||||
try
|
||||
{
|
||||
for (auto & encoder: encoders)
|
||||
{
|
||||
encoder->Encode(*cn->cnx, cn->psc.view_info, cn->psc.frame_index);
|
||||
}
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
U_LOG_W("encode error: %s", e.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Ignore errors
|
||||
}
|
||||
auto res = vk.device.waitForFences(*cn->psc.fence, true, UINT64_MAX);
|
||||
|
||||
// Update encoder status, release image
|
||||
if ((cn->psc.status &= ~status_bit) == 0)
|
||||
@@ -422,6 +410,22 @@ static void comp_wivrn_present_thread(std::stop_token stop_token, wivrn_comp_tar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
for (auto & encoder: encoders)
|
||||
{
|
||||
encoder->Encode(*cn->cnx, view_info, frame_index);
|
||||
}
|
||||
}
|
||||
catch (std::exception & e)
|
||||
{
|
||||
U_LOG_W("encode error: %s", e.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Ignore errors
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user