Map 32-bit games' GPU memory below 4 GiB on Qualcomm

32-bit DXVK titles failed every vkMapMemory with
VK_ERROR_OUT_OF_HOST_MEMORY: the Qualcomm driver maps above 4 GiB, which
WoW64 Wine rejects unless the device offers VK_EXT_map_memory_placed.

The bridge's placed-memory layer emulates that extension, but its
OPAQUE_FD path made every exportable resource external. This driver
reports OPAQUE_FD export as dedicated-only: external buffers and images
bind only to dedicated exported memory and cannot use the cached
host-visible type, so DXVK's first image bind failed with
VK_ERROR_INVALID_EXTERNAL_HANDLE.

0015-placed-memory-dedicated-export.patch adds a mode for such drivers:
resources stay native and each host-visible allocation that is not
dedicated already is dedicated to a hidden buffer of its size and
exported. The driver binds other resources to that memory, and the
dma-buf mapped at Wine's placed address is coherent with the GPU (probe
on the Pocket FIT: CPU writes through the low mapping, GPU copy, read
back). With a locally built layer, AIO's 32-bit DX11 cube ran 15 s at
142.8 FPS average.

Qualcomm sessions now load the layer with
DROIDDECK_EXPERIMENTAL_PLACED_MEMORY=1; it only acts for devices that
request VK_EXT_map_memory_placed.
This commit is contained in:
The412Banner committed 2026-10-26 07:18:10 +00:00
1 parent 3130f7f0c6
commit a132a6de97
3 files changed
+238 -2

No files matched your search

@@ -293,7 +293,10 @@ bl_xprop_set_all() {
export GDK_BACKEND=x11 QT_QPA_PLATFORM=xcb SDL_VIDEODRIVER=x11
if [ "${DROIDDECK_SYSTEM_QUALCOMM:-0}" = 1 ]; then
export VK_LAYER_PATH="$DROIDDECK_QUALCOMM_ROOT/wsi:$DROIDDECK_QUALCOMM_ROOT/lib"
export VK_INSTANCE_LAYERS=VK_LAYER_window_system_integration:VK_LAYER_HYBRIS_compat
# The placed-memory layer acts only for devices that ask for VK_EXT_map_memory_placed:
# Wine does for 32-bit games, whose mapped GPU memory must sit below 4 GiB.
export VK_INSTANCE_LAYERS=VK_LAYER_window_system_integration:VK_LAYER_HYBRIS_compat:VK_LAYER_DROIDDECK_placed_memory
export DROIDDECK_EXPERIMENTAL_PLACED_MEMORY=1
export VK_LOADER_DEBUG=error
export WSI_X11_FORCE_SHM=1 DISABLE_GAMESCOPE_WSI=1
. "$DROIDDECK_QUALCOMM_ROOT/mesa/qualcomm-gl.sh"