DirectX functionality similiar to wglShareLists in Opengl

Started by
4 comments, last by fanaticlatic 11 years, 6 months ago
Hello all,

I am having some trouble finding similiar functionality to Opengl's wglShareLists in Direct3D using the February 2005 sdk (old I know). I have only found the Create functions (like CreateTexture) take a Handle pointer, which when (pointer != NULL) && (*pointer == NULL) should set the (*pointer) value.

This handle value is then used on subsequent CreateTexture calls from other devices to share that texture across those devices.

This functionality is OS dependant requiring Vista or above to create a texture and return a value to the handle pointer. On XP the return from CreateTexture is E_NOTIMPL when sending anything in the HANDLE parameter other than NULL, this is expected and documented. It is unexpected to receive an error on Windows 7, which is what I am currently seeing!

From what I have read the CreateTexture call must come from an IDirect3DDevice9EX interface rather than the standard IDirect3DDevice9 interface. This would explain why the windows 7 unexpectedly fails as we currently create texture using vanilla IDIRECT3DDEVICE9 pointer.

Unfortunately the February 2005 sdk does not expose the extended device, at least not in the d3dx9.h header I have. I cannot find the directx 9 sdk that first provided these objects and nothing on the MSDN docs seems to point me in the right direction.

Any help on locating the SDK that exposes the functionality I require would be greatly appreciated.

Thanks in advance,

MarkH.
"I have more fingers in more pies than a leper at a bakery!"
Advertisement
It depends on why you require this functionality.

If you're using it for multithreaded rendering then you don't actually need to do an equivalent of the "one context per thread" dance that OpenGL needs. Just create with D3DCREATE_MULTITHREADED and ensure that you obey the restrictions on mode changes and you'll be fine. See http://msdn.microsoft.com/en-us/library/windows/desktop/bb172527%28v=vs.85%29.aspx and http://msdn.microsoft.com/en-us/library/windows/desktop/bb147224%28v=vs.85%29.aspx for more info.

If you want to have multiple windows in your program, then you do that via swap chains instead of creating multiple devices. Use IDirect3DDevice9::CreateAdditionalSwapChain, associate the present parameters for each new swap chain with the HWND of the window it's to use, and Present through each swap chain rather than through the device.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Thanks for the response mhagain.

Firstly great shout about swap chains and normally this is what I would do in a single device system.

However, I am looking at a multi-monitor multi-device system to make use of dual/quad graphics cards and am therefore rendering in fullscreen mode. This means I need to share resources between devices.

So any help on locating the earliest sdk that opened up the extended device functionality would be awesome.

Thanks again.

MarkH.
"I have more fingers in more pies than a leper at a bakery!"
Why exactly do you want the earliest SDK that supports it?
I doubt you can share resources between different physical GPUs.. I believe the devices must share the underlying adapter. Please correct me if I'm wrong.

Why exactly do you want the earliest SDK that supports it?


I want to prevent migrating too far away from the February 2005 sdk that I am currently using if at all possible. As it could well end up a series of retrospective fixes to patch up the current engine to the potentially more recent directx sdk. Basically I would consider a jump to August 2007 sdk less risky than a jump to the latest sdk for example.



I doubt you can share resources between different physical GPUs.. I believe the devices must share the underlying adapter. Please correct me if I'm wrong.

Providing the gpu utilises the same device driver then its possible, this means they have to be from the same family of card so no NVidia/Ati combinations. At least on opengl using wglsharelists. The sharelists basically drops a copy onto each gpu adapters memory so when the RAM copy is changed this is reflected in the GPU copies. Thats my understanding anyway.
"I have more fingers in more pies than a leper at a bakery!"

This topic is closed to new replies.

Advertisement