Direct3D 11 Single SwapChain? (Torque 3D 3.9)

Expanding and utilizing the engine via C++.
  • 1
  • 2
13 posts Page 1 of 2
PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
by PacoMontanes » Tue Aug 23, 2016 6:46 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...
JeffR
Steering Committee
Steering Committee
Posts: 642
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Sun Aug 28, 2016 7:05 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.
PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
by PacoMontanes » Mon Aug 29, 2016 12:10 am
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.
JeffR
Steering Committee
Steering Committee
Posts: 642
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Sep 16, 2016 6:31 am
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 :)
PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
by PacoMontanes » Fri Sep 16, 2016 9:30 am
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! :D
Timmy
Posts: 237
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Sep 16, 2016 10:00 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.
PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
by PacoMontanes » Fri Sep 16, 2016 10:22 am
Perfect! :)
Timmy
Posts: 237
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Sun Sep 18, 2016 4:19 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
PacoMontanes
Posts: 14
Joined: Mon Feb 09, 2015 2:35 pm
by PacoMontanes » Mon Sep 19, 2016 5:11 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)
> CanvasB.setContent( MainMenuGui )
And then press F11 or F10
(If you press F11 again remains in black.)

Image
Timmy
Posts: 237
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Tue Sep 20, 2016 1:52 am
Ok no worries, will check that out and fix it.
  • 1
  • 2
13 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 2 guests