locked
CreateSwapChainForComposition or CreateSwapChainForCoreWindow

    Question

  • In a Direct2D App (XAML) prototype project, CreateSwapChainForComposition is used. Whereas in a Direct3D App prototype project, CreateSwapChainForCoreWindow is used. I wonder if these two functions can be interchanged. I find that Direct2D App (XAML) prototype project uses the SwapChainBackgroundPanel scheme,  but what about a project that employs SurfaceImageSource/VirtualSurfaceImageSource scheme, CreateSwapChainForComposition or CreateSwapChainForCoreWindow?
    Wednesday, October 3, 2012 1:29 PM

Answers

All replies

  • Hi,

    "For shared surfaces, you don't control the calls to present the swap chain(s)... updates to a SurfaceImageSource object are synced to XAML user interface updates..."

    More infos :

    http://msdn.microsoft.com/en-us/library/windows/apps/hh825871.aspx

    • Marked as answer by Leonard Friday, October 5, 2012 11:43 PM
    Wednesday, October 3, 2012 3:39 PM
  • Hi,

    "For shared surfaces, you don't control the calls to present the swap chain(s)... updates to a SurfaceImageSource object are synced to XAML user interface updates..."

    More infos :

    http://msdn.microsoft.com/en-us/library/windows/apps/hh825871.aspx

    Thanks for your quick response, t-n-x.

    I've read the article (except the sample code) you recommended but am still undecided on which approach to use for my GIS application that involves both 2D/3D large volume graphics rendering and quite a few XAML UI. It seems I can rule out the SurfaceImageSource scheme but it's hard to choose between VirtualSurfaceImageSource and SwapChainBackgroundPanel. The author suggested to use VirtualSurfaceImageSource for apps like maps, large-scale image viewer. But wouldn't it be better if one uses SwapChainBackgroundPanel to write these apps for higher performance? I got the impression that VirtualSurfaceImageSource is more flexible for UI layout design. For example the DirectX rendering target can be a portion of screen in VirtualSurfaceImageSource  but have to be the entire screen in SwapChainBackgroundPanel.

    Wednesday, October 3, 2012 5:38 PM
  • If you need only a limited number of children XAML elements you will get better performance with a SwapChainBackgroundPanel.
    Wednesday, October 3, 2012 10:09 PM
  • The number of UI elements may dependent on customers' feedback and therefore change in the future. This troublesome issue makes the decision difficult. Maybe we should try both schemes to find out which is more suitable. But how difficult to switch from one scheme to another?
    Wednesday, October 3, 2012 11:21 PM