DX9 Multiple Devices for Seperation

Started by
5 comments, last by Hodgman 6 years, 6 months ago

Hello Community,

I wanted to seperate drawings - different "IDirect3DDevice9Ex"  Devices for different purposes.

The problem I have is that Device A is drawing the background and if I add Device B for drawing simple geometricts or even a simple line.. the background turns black but the line is drawn. So I dont really know how to configure device B that it only overwrite the pixels at e.g. destination of the line and not all pixels of device A.

So what are the correct settings to archive the mentioned goal ?  (D3DPRESENT_PARAMETERS, Present/Clear)

,greetings

Advertisement
30 minutes ago, GAFO said:

So what are the correct settings to archive the mentioned goal ? 

If you want these different parts to contribute to drawing the same image, use one device.

28 minutes ago, Hodgman said:

If you want these different parts to contribute to drawing the same image, use one device.

so there is absolutely no way that the second device only overwrites the backbuffer parts of e.g. lines location instead of everything ? 

 

6 minutes ago, GAFO said:

so there is absolutely no way that the second device only overwrites the backbuffer parts of e.g. lines location instead of everything ? 

 

I don't think you can share the backbuffer (aka swap chain) between devices... You can share other resources, such as intermediate render-targets (https://msdn.microsoft.com/en-us/library/bb219800(VS.85).aspx#Sharing_Resources) so technically it's possible. It's likely slower and more wasteful on memory to create multiple devices when one would do though. It's also a lot more complicated as you'll have to use event queries to force your commands to be executed by the GPU in the intended order, which may harm GPU throughput.

 Why do you need to create multiple devices?

4 minutes ago, Hodgman said:

Why do you need to create multiple devices?

well I want design a way which allows me to have a base programm and additional modules which can be loaded for additional rendering 

without them knowing the private environment of the base nor the other way around. So every module manages and renders itself and the only knowledge they share is the window handle.

23 minutes ago, GAFO said:

So every module manages and renders itself and the only knowledge they share is the window handle.

Instead of sharing the window handle, share the device pointer instead :) 

This topic is closed to new replies.

Advertisement