Skip to content

Fix Android Virtual Swapchain ANativeWindow collision after AdHoc presentation - #19

Open
olehkuznetsov wants to merge 1 commit into
android-graphics:devfrom
olehkuznetsov:experiment2
Open

Fix Android Virtual Swapchain ANativeWindow collision after AdHoc presentation#19
olehkuznetsov wants to merge 1 commit into
android-graphics:devfrom
olehkuznetsov:experiment2

Conversation

@olehkuznetsov

Copy link
Copy Markdown

...

…sentation

When replaying Android traces, the replay runtime sometimes utilizes an AdHoc surface presentation layer to visualize headless loading phases. However, in the original architecture, this AdHoc surface held onto system OS Window resources permanently.

When the trace finally attempted to create its genuine swapchain surface (e.g. vkCreateAndroidSurfaceKHR), it would fail with VK_ERROR_NATIVE_WINDOW_IN_USE_KHR because the window was still bound to the AdHoc surface.

Changes:

- Overrode CreateSurface in VulkanVirtualSwapchain to intercept the application's genuine hardware surface request.

- When a real surface is requested, we now preemptively clear the internal adhoc_device_data_ and gracefully release the underlying ANativeWindow before delegating instantiation back to the base class.

- Introduced application_surface_created_ latch to permanently halt artificial AdHoc FrameBoundary renders once the application trace has successfully transitioned to rendering its own native pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant