• Advertisement
Sign in to follow this  

Swap Chains

This topic is 4276 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anybody have some really specific information on swap chains? I'm trying to find out if it's possible to have different render states (AA settings, etc) in two scenes in the same window, without having to create multiple devices. Are there settings that having only one device will not allow? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Hi,

One thing for sure, resources are created by device. This mean, you can't use "two scene" to do your rendering. Normally, Swap Chain are use to build tools like 3DSMax, where's 4viewport are rendering the scene from different views.

Another thing, SwapChain are simply RenderTarget associated to a Device. So, RenderStates are perDevice not per SwapChains. Exception to this, is SwapChain creation where you supply PresentParameters, but normally it's the same as the one use for device creation.

PS: It make a while i've implemented SwapChains in my engine, maybe if you need more help, ill dig the code out...

Hope this helps,
Jonathan

Share this post


Link to post
Share on other sites
None that I'm aware of. The only thing you can do with multiple swap chains that you don't need multiple devices for is rendering to a different swap chain (So you can composite two screens for instance).

All the device states that are lost when a device gets lost, and all resources are specific to a device, not a swap chain.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
... (So you can composite two screens for instance).


Can you elaborate on what this is?

Share this post


Link to post
Share on other sites
Notice in the below image there are several "views" of the scene. This is the kind of thing that could be done using multiple swap chains.



Also, you can learn more about swap chain creation and use here.

Cheers and good luck!

Share this post


Link to post
Share on other sites
Quote:
Original post by jwalsh
Notice in the below image there are several "views" of the scene.


I believe you can do that using just multiple viewports...

Share this post


Link to post
Share on other sites
Quote:
Original post by discman1028
Quote:
Original post by jwalsh
Notice in the below image there are several "views" of the scene.


I believe you can do that using just multiple viewports...
Yes, sort-of...

The multiple viewports technique requires that all views are still contained within the same parent window area. With multiple swap-chains you can target them at different window areas (new HWND's)...

In jwalsh's example you could define 4 regions and 4 swap-chains and have them arbitrarily placed in the window with other non-D3D controls/spacing between them. Or you could create one large D3D "window" and have 4 viewports that must be arranged next to each other - without any non-D3D controls/spacing between them.

Either is valid depending on what you want to achieve [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Ok, thanks.

Somewhat new question: say I went the direction of using multiple devices (w/ a single swap chain each). Say I want to change multisampling settings on one of the devices. (This is a setting that is specified during device creation.)

Do I have to Release() the device, and reload all things associated with the device? (textures, vertex buffers, etc) Or is there some way to preserve some things that were already loaded with the device?

Thanks.

Share this post


Link to post
Share on other sites
In other words: what's the best way to approach changing AA settings in-game? I know that releasing the device and re-creating it and all entities works, with a noticable pause of animation.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement