feat(vkbridge): emulation layer + VK_KHR_maintenance5 for drivers without it

Zink (Mesa 26.2) and DXVK 2.7 refuse a Vulkan 1.3 device without maintenance5. The server
installs dispatch-table wrappers: flags2 folded into 32-bit flags, inline shader modules,
BindIndexBuffer2/area granularity/subresource layout 2, VK_REMAINING_ARRAY_LAYERS and
VK_WHOLE_SIZE resolved from tracked images/buffers. Host: Zink glxgears in gamescope at
144 fps with the driver's maintenance5 hidden and the API capped at 1.3.

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 c3f02222fc
commit bf6dbb642a
7 files changed
+535 -23

No files matched your search

+8 -4
View File
@@ -7,9 +7,12 @@
const VkExtensionProperties *vkb_emu_extensions(vkb_physdev *pd, uint32_t *n)
{
(void)pd;
*n = 0;
return NULL;
static const VkExtensionProperties maint5 = {"VK_KHR_maintenance5", 1};
static __thread VkExtensionProperties list[8];
uint32_t c = 0;
if (pd->info.emu & VKB_EMU_MAINT5) list[c++] = maint5;
*n = c;
return list;
}
void vkb_emu_patch_limits(vkb_physdev *pd, VkPhysicalDeviceProperties *p) { (void)pd; (void)p; }
@@ -17,7 +20,8 @@ void vkb_emu_patch_properties_chain(vkb_physdev *pd, VkBaseOutStructure *b) { (v
void vkb_emu_patch_features(vkb_physdev *pd, VkPhysicalDeviceFeatures *f) { (void)pd; (void)f; }
void vkb_emu_patch_features_chain(vkb_physdev *pd, VkBaseOutStructure *b)
{
(void)pd;
if ((pd->info.emu & VKB_EMU_MAINT5) && b->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES)
((VkPhysicalDeviceMaintenance5Features *)b)->maintenance5 = VK_TRUE;
/* Host image copy hands the driver host pointers: never offered across the bridge. */
if (b->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_4_FEATURES) ((VkPhysicalDeviceVulkan14Features *)b)->hostImageCopy = VK_FALSE;
if (b->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_IMAGE_COPY_FEATURES) ((VkPhysicalDeviceHostImageCopyFeatures *)b)->hostImageCopy = VK_FALSE;