Transferring D3D textures to OpenGL or Vulkan contexts in Winelib

Ben "Root" Anderson roothorick at gmail.com
Sat May 13 21:11:01 CDT 2017


I'd like to start a discussion here and see where it goes.

First, my usecase. I want to write a wrapper that connects Windows
SteamVR applications running under Wine to the native Linux SteamVR
runtime. Because it's the same API on both sides, this is very
straightforward, except for one crucial element. In their API, the
application does not (necessarily) output the rendered frame to a
window, instead submitting the frame to their VR compositor as either
an ID3D11Texture, a struct describing a D3D12 texture, an OpenGL
texture or render buffer name, or a struct describing a Vulkan
texture. For obvious reasons, the latter two are the options available
on Linux, making them very straightforward for a Winelib DLL. The
former two... not so much.

The vast majority of SteamVR applications are currently using Direct3D
11, which means for any of this to work with them, I need some way to
convert an ID3D11Texture to the appropriate OpenGL or (preferably)
Vulkan equivalent that SteamVR is expecting. I've looked high and low
and see no way to do this, neither through Windows APIs nor Winelib.
Just to get things working for now, I'll likely figure out a way to
invoke wined3d_texture_get_gl_buffer() or similar from outside Wine
itself, but that's a dirty hack at best and likely to break frequently
(eventually, maybe permanently) as Wine evolves.

Thoughts?



More information about the wine-devel mailing list