#!/usr/bin/env bash
# mtt-vk32 — run an app's Vulkan through the MTT S80 32->64-bit bridge.
#
# Routes Vulkan via the Venus vtest ICD to the mtt-vk32bridge backend (which must
# be running: `systemctl --user enable --now mtt-vk32bridge.service`). Both the
# 32- and 64-bit Venus ICDs are listed; the Vulkan loader picks the one matching
# the app's arch (wrong-arch ICDs are skipped), so this works for 32-bit apps AND
# for 64-bit D3D/DXVK apps that need the bridge's feature-faking (robustness2).
#
# Usage: mtt-vk32 <app> [args...]
set -euo pipefail
ICDS="/usr/lib/mtt-vk32bridge/icd/mtt_virtio_i686.json:/usr/lib/mtt-vk32bridge/icd/mtt_virtio_x86_64.json"
export VN_DEBUG=vtest
export VK_ICD_FILENAMES="$ICDS"
export VK_DRIVER_FILES="$ICDS"
exec "$@"
