Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Shared resources (eg textures) between devices/threads


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
2 replies to this topic

#1 ori-on   Members   -  Reputation: 113

Like
0Likes
Like

Posted 08 February 2013 - 04:38 PM

In this Microsoft article it states that sharing of resources between different d3d devices is possible on Windows Vista. The description sounds straight forward, so I gave it a try on Windows 7, but only get an D3DERR_INVALIDCALL back, when I call CreateTexture()

 

pSharedHandle points to a HANDLE that is 0.

 

D3D debug dumps the following:

 

Direct3D9: (ERROR) :Device is not capable of sharing resource. CreateTexture fails.
Direct3D9: (ERROR) :Failure trying to create a texture

 

I am using an ordinary Direct3D 9 device, not Direct3D 9Ex. But according to the docs it should work with both. I am using a Radeon 57xx, and the drivers are pretty recent. According to the docs, WDDM drivers are a requirement. Since mine are a couple of months old, I believe they should be (this is the year 2013...).

 

Obviously one question comes to mind: is this a Vista only feature?? Maybe they kicked it out with Win7 again?

 

So my question is, does anyone successfully use the pSharedHandle parameter?



Sponsor:

#2 Tispe   Members   -  Reputation: 1047

Like
0Likes
Like

Posted 09 February 2013 - 03:54 AM

Hi

 

I think it Works on Vista because of DirectX10. You can't do this With D3D9. You need to create the texture and Lock it With Your main Device/thread. After you Lock it on the main thread you can give the lock pointer to another thread and have that copy data to the texture, send the Lock pointer back to the main thread and unlock it there. 


Edited by Tispe, 09 February 2013 - 03:54 AM.


#3 ori-on   Members   -  Reputation: 113

Like
1Likes
Like

Posted 09 February 2013 - 05:15 PM

Sharing textures (and other resources) between devices/threads works just fine as advertised, when using D3D9Ex (and not D3D9). I wish Microsofts' documentation would state that more clearly.

 

The reason is that only D3D9Ex utilizes the features provided through WDDM display drivers, like eg sharing resources. So D3D9Ex was specifically introduced for people like me that want to stick with D3D9, but want to use some of the features that were introduced with Vista (and later). So thanks for that to Microsoft :)

 

So the actual fix was to use Direct3DCreate9Ex() and CreateDeviceEx() instead of their D3D9 predecessors. Everything else remains the same.






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