class ChainedSemaphoreGenerator

Defined at line 40 of file ../../src/ui/lib/escher/vk/chained_semaphore_generator.h

ChainedSemaphoreGenerator is used for generating VkSemaphores for

synchronizing between gfx::Engine, gfx::Screenshotter, and gfx::Snaphshotter.

Each time the caller calls TakeLastAndCreateNextSemaphore() to get a pair of

VkSemaphore, which it will wait on |semaphore_to_wait| before executing

its command and signal |semaphore_to_signal| after finishing execution. When

the next caller calls this function, the caller will wait on the semaphore

signalled by the previous caller. In this way all components are chained

together and we can ensure the execution sequence of command buffers.

Therefore, the caller MUST always signal |semaphore_to_signal| in their

command buffer, otherwise the next caller will wait on this semaphore

forever.

Also, the caller MUST ensure that the submission sequence MUST be of the

same order of the semaphore chain, otherwise it will cause deadlock on most

platforms.

TODO(https://fxbug.dev/42118123): Add integration tests to test synchronization of gfx Engine,

Screenshotter and Snapshotter as well.

Public Methods

void ChainedSemaphoreGenerator (vk::Device device)

Defined at line 15 of file ../../src/ui/lib/escher/vk/chained_semaphore_generator.cc

SemaphorePair TakeLastAndCreateNextSemaphore (bool exportable)

Defined at line 51 of file ../../src/ui/lib/escher/vk/chained_semaphore_generator.h

ChainedSemaphoreGeneratorWeakPtr GetWeakPtr ()

Defined at line 56 of file ../../src/ui/lib/escher/vk/chained_semaphore_generator.h

Records