gpu_helper: dual-path Vulkan init with runtime API-level branch - #1
Draft
Catpotatos with Copilot wants to merge 5 commits into
Draft
gpu_helper: dual-path Vulkan init with runtime API-level branch#1Catpotatos with Copilot wants to merge 5 commits into
Catpotatos with Copilot wants to merge 5 commits into
Conversation
-- still to be tested. currently being stuck at log in due to SQLite error from ( @query("SELECT * FROM epic_games WHERE is_dlc .... ) will come back to this once i can test
…r SQLite compatibility - changed DAO for EpicGame and GOGGame. This fixed crash in API 29 (Android 10) otherwise Skip steam login or steam log in triggers native crash.
Fix - ContainerConfigDialog.kt, gpuExtensions is computed inside remember { ... } and mutates gpuExtensionsErrorDialogState inside the catch. That is a side-effect during composition (inside remember init), which can lead to invalid bytecode / verifier failure on some devices (especially older runtimes like API 29) - created GpuCompatHelper to avoid the issue.
This commit refactors the handling of Vulkan extension retrieval for API 29 devices with Mali GPUs.
The logic, which previously existed directly within `ContainerConfigDialog.kt`, has been extracted into a new `GpuCompatHelper` class. This helper now safely attempts to get the device's Vulkan extensions and provides a default list if the native call fails, preventing a crash.
The `ContainerConfigDialog` now uses this helper to get the extensions and displays an informational dialog to the user if the fallback list was used. This improves code organization and isolates the compatibility workaround.
…or Android 10 fix Co-authored-by: Catpotatos <221862400+Catpotatos@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix dynamic loading for Vulkan on Android 10
gpu_helper: dual-path Vulkan init with runtime API-level branch
Mar 5, 2026
Catpotatos
pushed a commit
that referenced
this pull request
Mar 28, 2026
Catpotatos
pushed a commit
that referenced
this pull request
Jul 4, 2026
…faceflinger crash (utkarshdalal#1620) * asr: rename lib and add fence to prevent surfaceflinger crash - previously it was loading a different .so that didn't have the necessary changes - add fences to help prevent tearing on cpu images * add GPU_FRAMEBUFFER and CPU_READ_OFTEN flag * change color format to R8G8B8A8_UNORM * refactor: separate GPUImage and AHBImage (#1) * fix asr color with swapping R/B * refactor: separate GPUImage and AHBImage - reverted GPUImage before PR utkarshdalal#1582 - added AHBImage to keep the changes from utkarshdalal#1582 - updated code usage on GPUImage and AHBImage * clean up AHBImage (#2) * revert changes to ASurfaceRendererContext, update Drawable for swap RB logic (utkarshdalal#3) * revert changes to ASurfaceRendererContext, update Drawable for swap RB logic * still need swapRB in nativeSetWindowBuffer * add blit converter and computer converter for bgra convertion * asr: only use blit converter with dedicated EGL thread * feat(SurfaceFlinger Renderer): add option to disable BGRA to RGBA color correction (utkarshdalal#4) Introduces a user-configurable setting for the ASurfaceRenderer to enable or disable the BGRA to RGBA color format conversion. Disabling this conversion can resolve graphical glitches on devices whose display drivers natively support BGRA. It may also reduce rendering overhead by skipping unnecessary blitting. * fix wording (utkarshdalal#5) * change naming and minor correction for cpu path * ahbimage: change default color format to BGRA compatibility mode converts it to RGBA --------- Co-authored-by: Joshua Tam <297250+joshuatam@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Android 10 (API 29), static Vulkan linking crashes at
vkCreateInstance. The fix is dynamic loading viadlopen/dlsym, but applying it unconditionally diverges unnecessarily from upstream. This PR restores the upstream static path for API > 29 and gates the dynamic-load fix behind a runtime check.Changes
Runtime branch —
Java_com_winlator_core_GPUHelper_vkGetDeviceExtensionsnow callsandroid_get_device_api_level()and dispatches to one of two static helpers:vkGetDeviceExtensions_dynamic(API ≤ 29) — resolvesvkCreateInstance,vkEnumeratePhysicalDevices,vkEnumerateDeviceExtensionProperties,vkDestroyInstanceviadlsym; populates a fullVkApplicationInfo; cleans up (vkDestroyInstance+dlclose) on every exit path; releases JNI local refs in the loop; null-checks all allocations and JNI calls.vkGetDeviceExtensions_static(API > 29) — upstream code verbatim; only change is the return typejlong→jobjectArray.Return type fix — the JNI entry point and both helpers now return
jobjectArrayinstead ofjlong, matching the Java declarationpublic static native String[] vkGetDeviceExtensions().make_empty_arrayhelper — shared by both paths; includes a null guard onFindClass.New includes —
<dlfcn.h>,<string.h>,<android/api-level.h>.Original prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.