mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
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:
1 parent
4050270511
commit
c3f02222fc
60 files changed
+31173
-7558
No files matched your search
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
"""
|
||||
Generates the Vulkan bridge's wire code from the pinned Khronos registry (vk.xml 1.3.247).
|
||||
Generates the Vulkan bridge's wire code from the pinned Khronos registry (vk.xml 1.4.341).
|
||||
|
||||
Output (into ../common/gen/):
|
||||
vkb_gen.h command ids, protocol hash, dispatch table, prototypes
|
||||
@@ -28,13 +28,14 @@ import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
REG = os.path.join(HERE, '..', 'third_party', 'Vulkan-Headers-1.3.247', 'registry', 'vk.xml')
|
||||
REG = os.path.join(HERE, '..', 'third_party', 'Vulkan-Headers-1.4.341', 'registry', 'vk.xml')
|
||||
OUT = os.path.join(HERE, '..', 'common', 'gen')
|
||||
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# What is bridged.
|
||||
|
||||
CORE_FEATURES = ['VK_VERSION_1_0', 'VK_VERSION_1_1', 'VK_VERSION_1_2', 'VK_VERSION_1_3']
|
||||
# Newer registries split each version into BASE/COMPUTE/GRAPHICS parts as well.
|
||||
CORE_FEATURES = [f'VK_{part}VERSION_1_{minor}' for minor in range(5) for part in ('', 'BASE_', 'COMPUTE_', 'GRAPHICS_')]
|
||||
|
||||
# Extensions whose name contains one of these are never bridged: platform-specific, display
|
||||
# control, ray tracing, video, or designs that hand raw host pointers/callbacks to the driver.
|
||||
@@ -53,7 +54,8 @@ EXT_BLOCK_SUBSTR = [
|
||||
'external_memory_rdma', 'external_memory_sci', 'external_sci', 'cluster_culling',
|
||||
'multiview_per_view', 'shader_enqueue', 'AMDX', 'cuda', 'CUDA', 'QNX', 'optical_flow',
|
||||
'low_latency', 'memory_decompression', 'copy_memory_indirect', 'frame_boundary',
|
||||
'device_fault', 'descriptor_set_host_mapping',
|
||||
'device_fault', 'descriptor_set_host_mapping', 'descriptor_heap', 'present_timing',
|
||||
'pipeline_binary', 'data_graph', 'host_image_copy',
|
||||
]
|
||||
# Structs never sent (callbacks into the app, or meaningless across processes); a pNext chain
|
||||
# carrying one is sent without it.
|
||||
@@ -248,6 +250,10 @@ class Registry:
|
||||
|
||||
|
||||
reg = Registry(REG)
|
||||
# Hand-maintained name lists may use extension names that a newer registry made aliases of core.
|
||||
CLIENT_CUSTOM = {reg.canon_cmd(c) for c in CLIENT_CUSTOM}
|
||||
SERVER_CUSTOM = {reg.canon_cmd(c) for c in SERVER_CUSTOM}
|
||||
FD_PARAMS = {(reg.canon_cmd(c), p) for c, p in FD_PARAMS}
|
||||
|
||||
# --------------------------------------------------------------------------------------------
|
||||
# Which commands/structs are in.
|
||||
@@ -354,13 +360,16 @@ client_only_cmds |= {'vkCreatePrivateDataSlot', 'vkDestroyPrivateDataSlot', 'vkS
|
||||
'vkGetInstanceProcAddr', 'vkGetDeviceProcAddr',
|
||||
'vkUpdateDescriptorSetWithTemplate', 'vkCmdPushDescriptorSetWithTemplateKHR',
|
||||
'vkMapMemory', 'vkUnmapMemory', 'vkMapMemory2KHR', 'vkUnmapMemory2KHR',
|
||||
'vkEnumerateDeviceLayerProperties'}
|
||||
'vkEnumerateDeviceLayerProperties', 'vkCmdPushDescriptorSetWithTemplate2',
|
||||
# Host image copy hands the driver raw host pointers; it is reported unsupported.
|
||||
'vkCopyMemoryToImage', 'vkCopyImageToMemory', 'vkCopyImageToImage', 'vkTransitionImageLayout'}
|
||||
|
||||
client_only_cmds = {reg.canon_cmd(c) for c in client_only_cmds}
|
||||
wire_cmds = sorted(c for c in included_cmds if c not in client_only_cmds)
|
||||
# Server-only entries in the dispatch table (used by the server itself, never on the wire).
|
||||
SERVER_DISPATCH_EXTRA = ['vkMapMemory', 'vkUnmapMemory', 'vkGetMemoryHostPointerPropertiesEXT',
|
||||
'vkUpdateDescriptorSetWithTemplate', 'vkCmdPushDescriptorSetWithTemplateKHR']
|
||||
dispatch_cmds = sorted(set(wire_cmds) | set(SERVER_DISPATCH_EXTRA))
|
||||
dispatch_cmds = sorted(set(wire_cmds) | {reg.canon_cmd(c) for c in SERVER_DISPATCH_EXTRA})
|
||||
# Wire-only helpers that are not Vulkan commands (handled by hand on both sides).
|
||||
EXTRA_WIRE = ['vkbHello', 'vkbQueryServer', 'vkbDescUpdateRaw', 'vkbPushDescRaw']
|
||||
|
||||
@@ -547,7 +556,7 @@ class W:
|
||||
return '\n'.join(self.lines) + '\n'
|
||||
|
||||
|
||||
HEADER = '/* Generated by tools/vkbridge/codegen/gen_vkbridge.py from vk.xml 1.3.247 - do not edit. */\n'
|
||||
HEADER = '/* Generated by tools/vkbridge/codegen/gen_vkbridge.py from vk.xml 1.4.341 - do not edit. */\n'
|
||||
|
||||
# Ordered list of structs (deterministic).
|
||||
STRUCTS = sorted(needed_structs)
|
||||
@@ -837,7 +846,7 @@ hw = W() # header
|
||||
cmd_ids = EXTRA_WIRE + wire_cmds
|
||||
proto_hash = hashlib.sha256(('\n'.join(cmd_ids) + '\n'.join(STRUCTS)).encode()).hexdigest()[:16]
|
||||
|
||||
hw('/* Generated by tools/vkbridge/codegen/gen_vkbridge.py from vk.xml 1.3.247 - do not edit. */')
|
||||
hw('/* Generated by tools/vkbridge/codegen/gen_vkbridge.py from vk.xml 1.4.341 - do not edit. */')
|
||||
hw('#ifndef VKB_GEN_H')
|
||||
hw('#define VKB_GEN_H')
|
||||
hw('#define VK_NO_PROTOTYPES 1')
|
||||
|
||||
Reference in new issue
Block a user