Sign in to follow this  
Drunken_Coder

D3D9 multihead

Recommended Posts

Drunken_Coder    122
I have a D3D9 app running in windowed mode, on a system with a dualhead display. When the app is moved onto the second monitor, it continues to function, but slows down significantly. I've found lots of documentation on handling multi-head, but no reference to how I should handle this in particular (as well as how to handle what goes on when the app is going across the boundary of both monitors. Help!

Share this post


Link to post
Share on other sites
lostincpp    122
I don't know if this is applicable to your problem or not, but we use a lot of dual monitor configurations and I've seen similar "different behaviour" issues when dragging a window between monitors.

Most of my problems have been resolved by making sure that both of the video drivers for the monitors have the same resolution, refresh rate, and color depth settings.

Share this post


Link to post
Share on other sites
Drunken_Coder    122
Unfortunately the settings are identical on both screens. The only solution I can see is to run two devices, but it seems from reading the docs that this would require separate resources, separate windows, and separate Present() calls. Is there any way to make two devices split two halves of the same window, and can I make them share resources (texture and vertex buffers)?

Share this post


Link to post
Share on other sites
circlesoft    1178
Quote:
Original post by Drunken_Coder
Unfortunately the settings are identical on both screens. The only solution I can see is to run two devices, but it seems from reading the docs that this would require separate resources, separate windows, and separate Present() calls. Is there any way to make two devices split two halves of the same window, and can I make them share resources (texture and vertex buffers)?

The whole multi-monitor area has always been kind of blurry with D3D (I guess it was never a big issue, seeing as few, if no, commercial games use it), but I am guessing that with D3D9, no. All multimon apps I've seen have to create two or more devices and clone resources appropriately.

Share this post


Link to post
Share on other sites
Drunken_Coder    122
I was afraid of that, as it is true that it is a minor issue for commercial games. I am not writing a game however, but new video renderer for a video player (it's a commercial player, so it has to be able to cope with such cases seamlessly).

The renderer must be fast enough to handle 1080p, so updating the video texture twice per frame would be prohibitive. is there some way to create two devices, a texture for each device, and then quickly update both textures without hitting the data bus twice?

Share this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by Drunken_Coder
The renderer must be fast enough to handle 1080p, so updating the video texture twice per frame would be prohibitive. is there some way to create two devices, a texture for each device, and then quickly update both textures without hitting the data bus twice?
Not in D3D9, I think there's some crazy stuff you can do with D3D10 though.

Share this post


Link to post
Share on other sites
psykr    295
Ugh, I did way too much research on multi-head devices. What I think is happening is this: on the first monitor, everything renders fine and dandy. When moving to the second monitor, it is being controlled by essentially a different device (to Direct3D), and so the back buffer is copied onto the "second" head which makes it much slower on the second monitor.

Multi-head scenarios under D3D9 are only supported under certain conditions. I think if this is supported this is your best bet, but the usage scenarios are very limited; check DXSDK article(s) on multi-head for details.

Share this post


Link to post
Share on other sites
Adam_42    3629
You shouldn't need to transfer double the data over the bus if you're careful - you only need to update the areas of the texture that are actually visible on the monitor associated with each device. You just need to pass appropriate rectangles to IDirect3DDevice9::UpdateSurface().

Of course I'm assuming you're just rendering the video as a rectangle, and not say applying it to some geometry.

Share this post


Link to post
Share on other sites
Drunken_Coder    122
Yeah, I thought about doing it that way. keeping two textures and doing two partial copies on the source buffer. It would probably work just fine that way but it's more work than I currently have time for. We have decided to avoid the issue for now.

Also, I found out that apparently opengl has always had seamless support for these kinds of things. We may be switching to an opengl renderer in the long term anyway as we also have to support mac.

Share this post


Link to post
Share on other sites
qingrui    118
The standard solution is what is showed in DXUT, that is, to recreate the device when moved to another monitor with the new adapter index. The adapter index indicates which adapter the device is bound to. If you don't recreate device, it has to do a copy. The speed drop (about 1/2 in my case) caused by this has something to do with video driver version. Generally newer drivers do better. However note that the way to detect moving across monitors is not perfect, as some times it can fail to detect the change.

This is not a DX issue through my tests. OpenGL context is also bound to the adapter it was created on.

Share this post


Link to post
Share on other sites
kafbuddy    139
If you want to run D3D9 on 2 monitors at the same time use adapater groups.

With this technique you don't have to create 2 devices and you still can share all resources.

Here is a link to an ATI presentation:

http://ati.amd.com/developer/MultiHead_DX9_mojo_day.pdf

And here a demo application:

http://ati.amd.com/developer/samples/dx9/MultiHead.html

Share this post


Link to post
Share on other sites
qingrui    118
Quote:
Original post by kafbuddy
If you want to run D3D9 on 2 monitors at the same time use adapater groups.

With this technique you don't have to create 2 devices and you still can share all resources.

Here is a link to an ATI presentation:

http://ati.amd.com/developer/MultiHead_DX9_mojo_day.pdf

And here a demo application:

http://ati.amd.com/developer/samples/dx9/MultiHead.html


That only works in full-screen mode, both monitors.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this