vulkan: Use goldfish-sync to wait after vkQueueSubmit on Fuchsia

Previously, if a vkQueueSubmit() call needs to signal some external
(zircon event / syncfd) semaphores, it has to schedule a work thread,
calling "vkQueueWaitIdle()" on that thread. On Fuchsia, this caused
higher CPU usage on these worker threads.

Instead, we could use the goldfish-sync device to trigger a "host
wait" on host SyncThread, and notify guest by device interrupts.

In this case, we need a temporary VkFence created for each
vkQueueSubmit with external semaphores (we cannot use the |fence|
argument because clients can reset it later):

- Every time a client calls "vkQueueSubmit()", it creates a
  temporary VkFence, and replace |fence| argument with this fence.
- Then it triggers a goldfish-sync device host wait on the temporary
  fence, and start waiting on the async loop.
- Once the goldfish-sync device notifies client (by signalling the
  Zircon fence), it destroys the tempFence, and signal events and
  original |fence|.

We also move the Fuchsia code from multi-thread WorkPools to a
Fuchsia native async event loop, thus the code path will diverge
a bit; let's separate the vkQueueSubmit() logic for Fuchsia and
Android for now, and we can refactor it once all the asynchronous
external VkSemaphore work has finished.

Bug: fxbug.dev/58325
Change-Id: I83e65dd562f8253cab9ccd7374d323967061015c
1 file changed