This project provides a native Linux shared library (libds_runtime.so) and
an optional C ABI (include/ds_runtime_c.h) that can be used as the backend
for a Wine/Proton-facing shim. This document outlines how to wire that shim
into Wine/Proton and what pieces still need to be implemented.
- Provide a stable Linux
.sothat can be loaded by Wine/Proton glue code. - Keep the C ABI small and explicit so it can be used from a PE/ELF bridge.
- Allow iterative replacement of stub DirectStorage APIs with real behavior.
cmake -B build -S . -DDS_BUILD_SHARED=ON -DDS_BUILD_STATIC=OFF
cmake --build build
cmake --install build --prefix ~/.localThis installs:
libds_runtime.soin~/.local/libinclude/ds_runtime_c.hin~/.local/includeds-runtime.pcforpkg-config
Implement a dstorage.dll (PE DLL) that forwards key DirectStorage entry points
to the Linux backend through the C ABI. This DLL can be built in the Wine tree
or as a separate out-of-tree module. The shim typically does:
dlopen("libds_runtime.so")dlsym()for theds_*C functions- Translate
DSTORAGE_*requests intods_requestentries - Submit requests via
ds_queue_submit_all - Call back into Wine completion logic from the C callback
- For Wine, build
dstorage.dllas a builtin and setWINEDLLOVERRIDES="dstorage=b". - For Proton, add the DLL to the compatible prefix and override in the prefix configuration if needed.
If you want to avoid a separate shim DLL entirely, the simplest path is to compile ds-runtime directly into Wine/Proton and call the backend from the DirectStorage implementation itself:
- Add ds-runtime as a subproject or static library dependency in the Wine build.
- Instantiate
ds::VulkanBackendConfigwith the Vulkan device/queue already created by Proton’s D3D12 → Vulkan stack. - Submit requests with
RequestMemory::Gpu(orDS_REQUEST_MEMORY_GPUvia the C API) and pass the targetVkBufferhandle throughgpu_buffer.
This keeps the data path entirely inside the Wine/Proton process and avoids any PE/ELF bridging. The Vulkan backend in this repo is designed to accept externally-owned Vulkan objects without taking ownership.
For Arch Linux packaging and Vulkan runtime notes, see docs/archlinux_vulkan_integration.md.
The current runtime offers:
-
POSIX file descriptor reads via
pread -
POSIX file descriptor writes via
pwrite -
GPU buffer transfers via Vulkan staging copies (read ↔ GPU, write ↔ GPU) using
gpu_buffer,gpu_offset, and the host/GPU memory flags in each requestgpu_buffermust be a validVkBuffercreated on the backend's device.
-
A fake "uppercase" transform in place of decompression
As the runtime grows, extend the shim to map:
- I/O queues and fences to Wine/Proton synchronization primitives
- GPU decompression paths to Vulkan compute or vendor APIs
- Compression formats (e.g., GDeflate) to real codecs
The ds_runtime_c.h ABI is intended to stay stable and minimal. If additional
DirectStorage features are needed, add them by introducing new functions rather
than changing existing structs in-place.