Repository: godot
Issue: Support way to create Vulkan surface under Freedreno/Mobile Vulkan that does not expect X11
Labels: enhancement,topic:rendering,topic:porting

### Tested versions

4.3

### System information

ARM64 Android with Godot 4.3 under a PRoot environment and a valid X11 desktop session, using Termux and Termux-X11

### Issue description

I have an Android gaming tablet with Snapdragon 8 Gen 3 with 16GB of RAM, and although I know that there is an Android version of the Godot Editor, I mainly program in C#, and the Android editor does not contain the dotnet compiler, and thus I'm forced to go the Termux + Debian Proot + Termux-X11 setup, and so I install both VSCode and dotnet compiler in it, get a Linux desktop environment running, and then run the real Linux Godot Editor for ARM64 with its full potential.

I confirm that I can run the dotnet compiler and build a full-fledged C# project after setting the environmental variable `DOTNET_GCHeapHardLimit=1C0000000`, [which is a known bug since dotnet 7](https://github.com/dotnet/runtime/issues/85556), I even tested it with NativeAOT, and I have confirmed my GPU driver is working right by using Freedreno. 

Note that I cannot use the Android-native Vulkan driver because Android vendors usually implement a subset of Vulkan in a non-conformant and not-so-correct way, so I'm forced to use Freedreno that takes a little bit of performance hit, but it should guarantee more way Vulkan conformance given Mesa would follow the standard strictly.

I tried to launch Godot Editor under my environment, but I noticed that Vulkan failed to initialize, and so are other rendering drivers (both GL and GLES failed as well). 

I'm getting very close to make it run, so I did some diagnostic. My speculation is that https://github.com/godotengine/godot/blob/fafc07335bdecacd96b548c4119fbe1f47ee5866/platform/linuxbsd/x11/rendering_context_driver_vulkan_x11.cpp#L50-L51 is the culprit. My guess is that `vkCreateXlibSurfaceKHR` failed and returns the equivalent "not implemented", and it is expected for `vkCreateAndroidSurfaceKHR` to be used instead. This could be a vendor-specific issue, as indeed Qualcomm wouldn't expect people to run X11 under Android. 

Strangely, I have also tested the whole thing again, but this time using LLVMPipe as the Mesa driver. This means all the Vulkan, OpenGL and GLES are now technically software rendering. Everything works including mouse and sound (although I haven't tested packaging), but obviously that wouldn't be very efficient since everything graphics related is processed by CPU, and we can't just let the Adreno GPU sit idle. ~~I suspect the Vulkan backend still doesn't work~~ (Actually that is lavapipe), but both GL and GLES backend should technically work given Mesa and LLVMPipe is doing all the heavyliftings, and there is an automatic backend selection to either one of the two that works.

So now we have two problems:
1. Is there any ways to bypass `vkCreateXlibSurfaceKHR` and find a more compatible fallback?
2. Can the Godot Android Editor include C# support as well? Given that I can run dotnet inside Termux already, so given the right dotnet SDK home configuration, we can technically spawn the dotnet process using syscall (heck, maybe `system(3)` would work as well). How to get language servers to work on the Android Editor is another issue since we cannot use VSCode

### Steps to reproduce

1. Install a Termux instance and Linux desktop environment with GPU acceleration under Proot. I recommend using [this](https://github.com/sabamdarif/termux-desktop) and Snapdragon devices as they have open-source GPU driver that is usable in userspace.
2. Install Termux-X11
3. Run the Termux-X11 and Termux X11 session altogether so that the X11 surface is valid and confirm that GPU is working by running vkcube or glxgears
4. Install dotnet for ARM64 under that Termux session, and make sure `DOTNET_GCHeapHardLimit=1C0000000` is rightfully set for all shell profiles
5. Download Godot editor for Linux ARM64 and run it inside the Termux X11 session with GPU acceleration

### More details

https://github.com/sabamdarif/termux-desktop/issues/56