mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] fix cmd buffer recycling bug in test. (flutter/engine#50615)
Speculative fix for a flake seen by @matanlurey . In the past we've seen race conditions when a single DeathRattle is used, because it actually gets destructed before the cmd pool state. By adding two and waiting we guaranteee that everything has completed in the resource manager.
This commit is contained in:
parent
9b11e555f4
commit
a656286e39
@ -128,13 +128,15 @@ TEST(CommandPoolRecyclerVKTest, CommandBuffersAreRecycled) {
|
||||
}
|
||||
|
||||
// Wait for the pool to be reclaimed.
|
||||
auto waiter = fml::AutoResetWaitableEvent();
|
||||
auto rattle = DeathRattle([&waiter]() { waiter.Signal(); });
|
||||
{
|
||||
UniqueResourceVKT<DeathRattle> resource(context->GetResourceManager(),
|
||||
std::move(rattle));
|
||||
for (auto i = 0u; i < 2u; i++) {
|
||||
auto waiter = fml::AutoResetWaitableEvent();
|
||||
auto rattle = DeathRattle([&waiter]() { waiter.Signal(); });
|
||||
{
|
||||
UniqueResourceVKT<DeathRattle> resource(context->GetResourceManager(),
|
||||
std::move(rattle));
|
||||
}
|
||||
waiter.Wait();
|
||||
}
|
||||
waiter.Wait();
|
||||
|
||||
{
|
||||
// Create a second pool and command buffer, which should reused the existing
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user