### Direct3D 11 Single SwapChain? (Torque 3D 3.9)

Expanding and utilizing the engine via C++.
• 1
• 2

#### Direct3D 11 Single SwapChain? (Torque 3D 3.9)

PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
Hi,

Please, I need some advice... I'm migrating my protect to 3.9. I used to use some windows (few GuiCanvas). It works in D3D9, but not in D3D11. I tried to figure out why, and I found that there is a single SwapChain per device. I'm rigth? I think to mimic the architecture of the implementation of D3D9 will be too complicated. Don't you think? So I'm afraid that I'll have to merge all windows in a single one. This will be a painful task, because I have lots of GuiCanvas configured. What else can I do? What do you think guys?

Edit: What I really need, is to know how could I make an application in multi display using D3D11? In fact, I only need only 1 render target in just 1 of the displays. The others displays only shows gui elements. Should I have to make a big window and spread it through all the displays? I'm not very happy this this solution, but perhaps there are no more alternatives...

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

JeffR
Steering Committee
Posts: 682
Joined: Tue Feb 03, 2015 9:49 pm

So you have one window that's the main game render, one that displays a particular render target, and then the others are just regular gui controls, if I'm reading this right?

Will have to take a look and see what'd be needed for a setup like that.

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
Thank Jeff! Yes, you are right. The issue can be reproduced instancing 2 GuiCanvas and adding content on both. Only one of the windows show something, but just flicking garbage... I have to remark that works properly on D3D9.

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

JeffR
Steering Committee
Posts: 682
Joined: Tue Feb 03, 2015 9:49 pm

Hey Paco!

Alright, as a bit of an update to circle back on this, was able to replicate this and also affirmed it's broken for OpenGL as well(dunno if you were bothering with it at all).

So we'll have a look into this and try and get it patched up. I wanted to branch out the editor to have the option of popping some controls out into second windows, so I think this is a pretty important thing to fix

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
Hi Jeff,
Sorry I didn't try with OpenGL, because nowadays I'm only interested in D3D11.
I'm always working with some windows at once, and I only work with the editor in the main window, I think it's no needed to work like you propose (adding content directly from the editor to other windows). I just edit the gui files in the editor, and in game simply add the gui file to the Canvas, like always:

Code: Select all

Canvas.setContent("PlayGui");CanvasB.setContent("LoadingGui");

As I nearly understand, D3D9 creates a swapchain for every window, but D3D11 (and perhaps OpenGL) only instances one of them per device.
Please, you can count on me to proceed with any test or anything!

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

Timmy
Posts: 238
Joined: Thu Feb 05, 2015 3:20 am
Yes DX11 is not creating a different swap chain for each window target. Will through up a fix for it this weekend, i'll post the PR here so you can test it.

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
Perfect!

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

Timmy
Posts: 238
Joined: Thu Feb 05, 2015 3:20 am
If you want to try this out and we can fix any further problems i may have missed before sending in a proper PR. https://github.com/rextimmy/Torque3D/tree/dx11_multi_guicanvas

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
Hi Timmy,
I've already finish the test, and multi GuiCanvas works, but when you enter in editor (both worldeditor or guieditor) the render screen goes to black).

in console write:
> new GuiCanvas(CanvasB)
And then press F11 or F10
(If you press F11 again remains in black.)

#### Re: Direct3D 11 Single SwapChain? (Torque 3D 3.9)

Timmy
Posts: 238
Joined: Thu Feb 05, 2015 3:20 am
Ok no worries, will check that out and fix it.
• 1
• 2

#### Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests