Jump to content

  • Log In with Google      Sign In   
  • Create Account


DirectX functionality similiar to wglShareLists in Opengl


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 fanaticlatic   Members   -  Reputation: 458

Like
0Likes
Like

Posted 08 October 2012 - 11:33 AM

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!"

Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7564

Like
2Likes
Like

Posted 08 October 2012 - 11:57 AM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 fanaticlatic   Members   -  Reputation: 458

Like
0Likes
Like

Posted 09 October 2012 - 09:54 AM

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!"

#4 MJP   Moderators   -  Reputation: 10526

Like
0Likes
Like

Posted 09 October 2012 - 12:03 PM

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

#5 Erik Rufelt   Crossbones+   -  Reputation: 3139

Like
0Likes
Like

Posted 09 October 2012 - 06:23 PM

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.

Edited by Erik Rufelt, 09 October 2012 - 06:24 PM.


#6 fanaticlatic   Members   -  Reputation: 458

Like
0Likes
Like

Posted 10 October 2012 - 08:39 AM

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!"




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS