feat(vkbridge): Vulkan 1.4.341 registry, stand-in DRM node for gamescope, test switches

- registry moved from 1.3.247 to 1.4.341: current Zink and DXVK need post-1.3.247
  extensions (maintenance5); the bridge only exposes what the driver reports
- gamescope on the bridge: Mali's device stands in as the render node, the ICD reports its
  numbers (VKBRIDGE_DRM_RENDER), the session shim answers PRIME on it - linux-dmabuf works
- host: gamescope (Arch, no GPU device) composites vkcube through the bridge, zero-copy;
  Zink 26.2 runs GL 4.6 on the bridge
- VKBRIDGE_TRACE / HIDE_EXTS / MAX_API for diagnosis and imitating Mali on the host

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZqR8XUE8czvGzEpgSCVQR
This commit is contained in:
ahmadandClaude Opus 5.5 authored and Ahmad Sayed Alsayed Ebrahim committed 2026-10-10 14:28:13 +03:00
1 parent 4050270511
commit c3f02222fc
60 files changed
+31173 -7558

No files matched your search

+3 -3
View File
@@ -42,9 +42,9 @@ void vkb_sv_vkbPushDescRaw(vkb_srv_call *c)
vkb_srv_bad_message(c);
return;
}
if (!c->dt->vkCmdPushDescriptorSetWithTemplateKHR) {
vkb_srv_missing(c, "vkCmdPushDescriptorSetWithTemplateKHR");
if (!c->dt->vkCmdPushDescriptorSetWithTemplate) {
vkb_srv_missing(c, "vkCmdPushDescriptorSetWithTemplate");
return;
}
c->dt->vkCmdPushDescriptorSetWithTemplateKHR(cb, tmpl, layout, set, data);
c->dt->vkCmdPushDescriptorSetWithTemplate(cb, tmpl, layout, set, data);
}
@@ -296,10 +296,40 @@ public final class LinuxRuntime {
* may open) stands in: it appears as a render node with the sysfs entries libdrm reads, and our
* Turnip build reports the same device numbers for it.
*/
/** Mali's kbase device, the stand-in render node on a Mali GPU (the Mali bridge's gamescope). */
private static final String MALI_DEVICE = "/dev/mali0";
/**
* The device that stands in for the GPU's render node: KGSL on an Adreno; with the Mali bridge
* on, Mali's own device - nothing inside opens it for rendering (the bridge does that on the
* Android side), but gamescope and libdrm need a render node to name before they offer
* linux-dmabuf, and the bridge ICD reports this one's numbers. Null when there is none.
*/
public static String gpuStandIn(Context context) {
if (new File(KGSL_DEVICE).exists()) return KGSL_DEVICE;
if (com.droiddeck.launcher.core.DeviceSupport.INSTANCE.vkBridge(context) && new File(MALI_DEVICE).exists()) return MALI_DEVICE;
return null;
}
/** "major:minor" of a device node, or null. */
public static String deviceNumbers(String path) {
try {
long dev = Os.stat(path).st_rdev;
long major = ((dev >> 8) & 0xfff) | ((dev >> 32) & ~0xfffL);
long minor = (dev & 0xff) | ((dev >> 12) & ~0xffL);
return major + ":" + minor;
} catch (ErrnoException e) {
return null;
}
}
private static void bindGpuNode(Context context, List<String> cmd) {
String standIn = gpuStandIn(context);
if (standIn == null) return;
boolean kgsl = standIn.equals(KGSL_DEVICE);
StructStat st;
try {
st = Os.stat(KGSL_DEVICE);
st = Os.stat(standIn);
} catch (ErrnoException e) {
return;
}
@@ -319,7 +349,8 @@ public final class LinuxRuntime {
Files.write(new File(drm, "dev").toPath(),
(major + ":" + minor + "\n").getBytes(StandardCharsets.UTF_8));
Files.write(new File(device, "uevent").toPath(),
"DRIVER=kgsl-3d0\nMODALIAS=platform:kgsl-3d0\n".getBytes(StandardCharsets.UTF_8));
(kgsl ? "DRIVER=kgsl-3d0\nMODALIAS=platform:kgsl-3d0\n" : "DRIVER=mali\nMODALIAS=platform:mali\n")
.getBytes(StandardCharsets.UTF_8));
File subsystem = new File(device, "subsystem");
if (!Files.isSymbolicLink(subsystem.toPath())) {
Os.symlink("/sys/bus/platform", subsystem.getPath());
@@ -327,7 +358,7 @@ public final class LinuxRuntime {
// What MangoHud names a GPU's driver by; msm_drm is how an Adreno's render node reads
// on a mainline kernel, and the driver it reads the load of (bindAdrenoStats).
File driver = new File(device, "driver");
if (!Files.isSymbolicLink(driver.toPath())) {
if (kgsl && !Files.isSymbolicLink(driver.toPath())) {
Os.symlink("/sys/bus/platform/drivers/msm_drm", driver.getPath());
}
} catch (IOException | ErrnoException e) {
@@ -335,7 +366,7 @@ public final class LinuxRuntime {
}
bind(cmd, new File(base, "sys").getPath() + ":/sys/dev/char");
bind(cmd, dri.getPath() + ":/dev/dri");
bind(cmd, KGSL_DEVICE + ":/dev/dri/" + node);
bind(cmd, standIn + ":/dev/dri/" + node);
bindDrmClass(base, cmd, node, major + ":" + minor);
}
@@ -686,6 +686,12 @@ class SessionService : Service() {
guest.add("BL_VKBRIDGE=1")
guest.add("VKBRIDGE_SOCKET=" + socket.path)
guest.add("VKBRIDGE_CLIENT_LOG=" + File(sessionDir, "vkbridge-client.log").path)
// The render node gamescope sees is Mali's device standing in (LinuxRuntime.bindGpuNode):
// the ICD reports its numbers, and the session shim answers PRIME calls on it as on KGSL.
LinuxRuntime.gpuStandIn(this)?.let { node ->
guest.add("BL_DRM_STANDIN=$node")
LinuxRuntime.deviceNumbers(node)?.let { guest.add("VKBRIDGE_DRM_RENDER=$it") }
}
Log.i(TAG, "vkbridge: on (${com.droiddeck.launcher.core.DeviceSupport.gpuName(this)}), socket $socket")
}