Over an app's own Vulkan

A game draws into its SurfaceView's surface with its own device and swapchain on the window (the Vulkan pass-through, Native bridge). On Android, the surface is below the app's window: the SurfaceView clears its area of the window to transparent, and the compositor shows the window's views and dialogs over the game. The same happens here:

The two devices share no semaphore. The renderer's thread draws into an image that is not the one shown and that no blend still reads (the game's side tells it, from the fences of its blends). It releases the image to VK_QUEUE_FAMILY_EXTERNAL in layout GENERAL, then submits a fence on its queue after the frame. A present blends the newest image whose fence is signaled, and the older one until then. So a present never waits for the renderer, and the renderer waits for the game only when the game's blends still read every other image.

The blend is in the encoding of the swapchain: a UNORM swapchain blends the layer's bytes as they are. An sRGB swapchain reads the layer through an sRGB view, so that its edges of partial alpha are a little different from Android's.


Made from docs/platforms/android-apps/hwui.md at 69237645142c. GPL-3.0-or-later.