LunarG / gfxreconstruct

Graphics API Capture and Replay Tools for Reconstructing Graphics Application Behavior
https://vulkan.lunarg.com/doc/sdk/latest/linux/capture_tools.html
MIT License
378 stars 105 forks source link

Handle use of AHB on Android without QueuePresent with FrameBoundary as frame #1494

Open bradgrantham-lunarg opened 1 month ago

bradgrantham-lunarg commented 1 month ago

In some titles on Android (Sascha's raytracing demo was reported, a Vulkan-Samples sample was reported, and a benchmarking app was reported), an AHardwareBuffer is used as the framebuffer (color attachment) and then is noted as the framebuffer in vkFrameBoundaryANDROID using a semaphore from a QueueSubmit. Presumably the Android compositor then takes that AHB and blits it to the screen or composites it, etc.

We don't handle this case in replay so we can't show anything on the screen nor take screenshots. We have https://github.com/panos-lunarg/gfxreconstruct/tree/panos_hack_is_frame_boundary to attempt to save screenshots but this is just a hack.

For this issue, treat this mode as a first-class presentation mode; make sure capture honors this mode for trim range frame numbers (probably already does because of vkFrameBoundaryANDROID) and then augment our frame processing and display in replay on Android to show the completed image and correctly save off screenshots. Stretch goal would be to get an AHB from compositor/HWUI and use that so that display is handled the same way it was in capture.

marius-pelegrin-arm commented 1 month ago

Hello !

I created a PR (#1498) for supporting screenshots from vkFrameBoundaryANDROID. If accepted (or at least of the override is created) I will also modify #1440 to convert vkFrameBoundaryANDROID to a VkFrameBoundaryEXT when the option is set.

Presenting the image given in vkFrameBoundaryANDROID remains to be done.