On Tue, May 16, 2017 at 12:55 AM, Ben "Root" Anderson roothorick@gmail.com wrote:
On Sun, May 14, 2017 at 2:53 AM, Józef Kucia joseph.kucia@gmail.com wrote:
In theory Wine could implement WGL_NV_DX_interop [1] and WGL_NV_DX_interop2 [2].
[1] - https://www.khronos.org/registry/OpenGL/extensions/NV/WGL_NV_DX_interop.txt [2] - https://www.khronos.org/registry/OpenGL/extensions/NV/WGL_NV_DX_interop2.txt
In theory?
I'm just a bit skeptical about usefulness of this extension in Wine besides your use-case.
The main question I can't find the answer to is, are there any potential copyright/IP problems (or just Wine policy issues) with implementing these extensions "paint by numbers" off the published specs?
I'm not aware of such problems. Other WGL extensions are already implemented in Wine, see dlls/winex11.drv/opengl.c. In this case it may be a little harder though, the extension has to understand D3D9, D3D10 and D3D11 interfaces, and it has to talk to wined3d, and it has to presumably map GL objects to internal wined3d GL objects.
Am 16.05.2017 um 16:40 schrieb Józef Kucia:
I'm just a bit skeptical about usefulness of this extension in Wine besides your use-case.
This would also be useful for the CUDA implementation in Wine Staging. CUDA also allows accessing OpenGL and Direct3D buffers. So far it is only implemented for OpenGL, but if there was an easy way to get the OpenGL handles for a Direct3D object, it would be possible to implement at least some of these functions:
@ stub cuD3D10CtxCreate @ stub cuD3D10CtxCreateOnDevice @ stub cuD3D10CtxCreate_v2 @ stub cuD3D10GetDevice @ stub cuD3D10GetDevices @ stub cuD3D10GetDirect3DDevice @ stub cuD3D10MapResources @ stub cuD3D10RegisterResource @ stub cuD3D10ResourceGetMappedArray @ stub cuD3D10ResourceGetMappedPitch @ stub cuD3D10ResourceGetMappedPitch_v2 @ stub cuD3D10ResourceGetMappedPointer @ stub cuD3D10ResourceGetMappedPointer_v2 @ stub cuD3D10ResourceGetMappedSize @ stub cuD3D10ResourceGetMappedSize_v2 @ stub cuD3D10ResourceGetSurfaceDimensions @ stub cuD3D10ResourceGetSurfaceDimensions_v2 @ stub cuD3D10ResourceSetMapFlags @ stub cuD3D10UnmapResources @ stub cuD3D10UnregisterResource @ stub cuD3D11CtxCreate @ stub cuD3D11CtxCreateOnDevice @ stub cuD3D11CtxCreate_v2 @ stub cuD3D11GetDevice @ stub cuD3D11GetDevices @ stub cuD3D11GetDirect3DDevice @ stub cuD3D9Begin @ stdcall cuD3D9CtxCreate(ptr ptr long ptr) wine_cuD3D9CtxCreate @ stub cuD3D9CtxCreateOnDevice @ stub cuD3D9CtxCreate_v2 @ stub cuD3D9End @ stdcall cuD3D9GetDevice(ptr str) wine_cuD3D9GetDevice @ stub cuD3D9GetDevices @ stub cuD3D9GetDirect3DDevice @ stub cuD3D9MapResources @ stub cuD3D9MapVertexBuffer @ stub cuD3D9MapVertexBuffer_v2 @ stub cuD3D9RegisterResource @ stub cuD3D9RegisterVertexBuffer @ stub cuD3D9ResourceGetMappedArray @ stub cuD3D9ResourceGetMappedPitch @ stub cuD3D9ResourceGetMappedPitch_v2 @ stub cuD3D9ResourceGetMappedPointer @ stub cuD3D9ResourceGetMappedPointer_v2 @ stub cuD3D9ResourceGetMappedSize @ stub cuD3D9ResourceGetMappedSize_v2 @ stub cuD3D9ResourceGetSurfaceDimensions @ stub cuD3D9ResourceGetSurfaceDimensions_v2 @ stub cuD3D9ResourceSetMapFlags @ stub cuD3D9UnmapResources @ stub cuD3D9UnmapVertexBuffer @ stub cuD3D9UnregisterResource @ stub cuD3D9UnregisterVertexBuffer @ stub cuGraphicsD3D10RegisterResource @ stub cuGraphicsD3D11RegisterResource @ stub cuGraphicsD3D9RegisterResource
based on
@ stdcall cuGLCtxCreate(ptr long long) @ stdcall cuGLCtxCreate_v2(ptr long long) @ stdcall cuGLGetDevices(ptr ptr long long) @ stdcall cuGLInit() @ stdcall cuGLMapBufferObject(ptr ptr long) @ stdcall cuGLMapBufferObjectAsync(ptr ptr long ptr) @ stdcall cuGLMapBufferObjectAsync_v2(ptr ptr long ptr) @ stdcall cuGLMapBufferObject_v2(ptr ptr long) @ stdcall cuGLRegisterBufferObject(long) @ stdcall cuGLSetBufferObjectMapFlags(long long) @ stdcall cuGLUnmapBufferObject(long) @ stdcall cuGLUnmapBufferObjectAsync(long ptr) @ stdcall cuGLUnregisterBufferObject(long) @ stdcall cuGetErrorName(long ptr) @ stdcall cuGetErrorString(long ptr) @ stdcall cuGetExportTable(ptr ptr) @ stdcall cuGraphicsGLRegisterBuffer(ptr long long) @ stdcall cuGraphicsGLRegisterImage(ptr long long long)
On Tue, May 16, 2017 at 9:40 AM, Józef Kucia joseph.kucia@gmail.com wrote:
I'm just a bit skeptical about usefulness of this extension in Wine besides your use-case.
Definitely understandable. I think it's a big enough one to justify it in and of itself, however; this is critical middleware for a rapidly expanding library of games and applications. And I think getting SteamVR itself running in Wine is unrealistic due to how hardware-dependent it is.
I'm not aware of such problems. Other WGL extensions are already implemented in Wine, see dlls/winex11.drv/opengl.c. In this case it may be a little harder though, the extension has to understand D3D9, D3D10 and D3D11 interfaces, and it has to talk to wined3d, and it has to presumably map GL objects to internal wined3d GL objects.
I was asking because I'm completely naive to how IP works with OpenGL/WGL extensions. I take it, then, the vendor prefix has no bearing on whether any kind of permission or license is needed for implementation on the host side of things based solely on the public specification? I must sound so green...
It's going to be some time, as I want to get a few Vulkan and/or OpenGL programs to the point of submitting frames to the compositor before I tackle the D3D nut, but if no one else looks in the meantime, I'll have a go at implementing the dx_interop extensions and putting together a pullreq myself. I mostly wanted to gauge the viability of the project, as never having D3D11 support at all would defeat a large part of the point.