Skip to content

update lsvk integration (remove dead code, Improve layer stability and prevent freezes) - #4

Merged
utkarshdalal merged 4 commits into
releasefrom
update/lsvk-integration
Aug 17, 2026
Merged

update lsvk integration (remove dead code, Improve layer stability and prevent freezes) #4
utkarshdalal merged 4 commits into
releasefrom
update/lsvk-integration

Conversation

@joshuatam

Copy link
Copy Markdown
Collaborator

chore: update gitignore and android build script


refactor(android): streamline external memory and improve extension handling

Remove the AHardwareBuffer backed image creation path due to its limited compatibility and lack of robust support across various Android ICDs. The layer now exclusively uses VK_KHR_external_memory_fd for external memory sharing on Android.

Implement filtering for requested device extensions (VK_KHR_external_memory, VK_KHR_external_memory_fd, VK_KHR_external_semaphore, VK_KHR_external_semaphore_fd). This prevents device creation failures by only enabling extensions actually supported by the physical device.

Update the Android build script to use a consistent liblsfg-vk-layer.so filename and recommend installation to jniLibs/arm64-v8a/ for better Android app integration.


fix: Improve layer stability and prevent freezes in external mode

Enhances robustness by:

  • Replacing unbounded vkDeviceWaitIdle with bounded queue drains in external mode to prevent driver deadlocks.
  • Introducing a present thread watchdog to detect and report stalls in blocking Vulkan operations.
  • Adding an epoch system to invalidate framegen contexts after config reloads, forcing swapchain recreation.
  • Serializing access to shared layer state with a mutex to avoid race conditions during concurrent operations.
  • Ensuring VkPresentIdKHR is only passed with real frame presents to prevent game freezes on skipped generated frames.
  • Parking timed-out acquire semaphores to handle late signals from wrapper ICDs.

…andling

Remove the `AHardwareBuffer` backed image creation path due to its limited compatibility and lack of robust support across various Android ICDs. The layer now exclusively uses `VK_KHR_external_memory_fd` for external memory sharing on Android.

Implement filtering for requested device extensions (`VK_KHR_external_memory`, `VK_KHR_external_memory_fd`, `VK_KHR_external_semaphore`, `VK_KHR_external_semaphore_fd`). This prevents device creation failures by only enabling extensions actually supported by the physical device.

Update the Android build script to use a consistent `liblsfg-vk-layer.so` filename and recommend installation to `jniLibs/arm64-v8a/` for better Android app integration.
Enhances robustness by:
- Replacing unbounded `vkDeviceWaitIdle` with bounded queue drains in external mode to prevent driver deadlocks.
- Introducing a present thread watchdog to detect and report stalls in blocking Vulkan operations.
- Adding an epoch system to invalidate framegen contexts after config reloads, forcing swapchain recreation.
- Serializing access to shared layer state with a mutex to avoid race conditions during concurrent operations.
- Ensuring `VkPresentIdKHR` is only passed with real frame presents to prevent game freezes on skipped generated frames.
- Parking timed-out acquire semaphores to handle late signals from wrapper ICDs.
@utkarshdalal
utkarshdalal merged commit ea1e3f9 into release Aug 17, 2026
8 checks passed
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.

2 participants