locked
Multisampling with SurfaceImageSource

    Question

  • Hi,

    I'm using SurfaceImageSource (see: http://msdn.microsoft.com/en-us/library/windows/apps/hh825871.aspx ) to allow me to render DirectX content to an area of the screen in a standard C++/XAML Metro style app, i.e. it's not a fullscreen DirectX app.

    I'm looking at what antialiasing options are available, and I thought one easy thing to to would be to turn on multisampling to give whole scene antialiasing. However, I'm having trouble seeing how to do it. There does seem to be a way to enable multisampling in the texture that's used for the stencil buffer. I tried that and had no success, which led me to think that the SurfaceImageSource needs to be also set up as a multisample render target, but there appears to be no way to do that.

    Is it possible to use multisampling in this scenario?

    Robert


    • Edited by RobertHF Tuesday, July 17, 2012 9:29 AM link not working
    Tuesday, July 17, 2012 9:25 AM

Answers

  • Hi Robert,

    Here is the info I was able to find for you:

    For Metro style apps, we no longer resolve multi-sampled surfaces automatically for presentation.  Instead, you should create your own intermediate MSAA surface, then use ResolveSubresource to copy it to the non-MSAA SurfaceImageSource.  Note that compared to Desktop/Win7, this technique involves no additional copies, but rather moves the copy step from OS code into app code.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 23, 2012 12:09 PM
    Moderator

All replies

  • Hi Robert,

    From what I have read I do not think so, but I am engaging some other experts to find out for you!

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, July 18, 2012 6:16 PM
    Moderator
  • Hi Robert,

    Here is the info I was able to find for you:

    For Metro style apps, we no longer resolve multi-sampled surfaces automatically for presentation.  Instead, you should create your own intermediate MSAA surface, then use ResolveSubresource to copy it to the non-MSAA SurfaceImageSource.  Note that compared to Desktop/Win7, this technique involves no additional copies, but rather moves the copy step from OS code into app code.

    -Jeff


    Jeff Sanders (MSFT)

    Monday, July 23, 2012 12:09 PM
    Moderator
  • Thanks Jeff,

    I've been looking into doing something similar to that by first rendering to an intermediate texture, and then rendering a quad to the SurfaceImageSource using the intermediate texture as a shader resource for the SurfaceImageSource render target. This would seem to allow rendering to arbitrary textures before finally rendering to the SurfaceImageSource. I haven't got as far as making multisampling work yet, but this was a prerequisite.

    I wasn't familiar with ResolveSubresource, so I'll look into that.

    Thanks a lot,

    Robert

    Monday, July 23, 2012 1:16 PM
  • Hi Robert,

    Here is the info I was able to find for you:

    For Metro style apps, we no longer resolve multi-sampled surfaces automatically for presentation.  Instead, you should create your own intermediate MSAA surface, then use ResolveSubresource to copy it to the non-MSAA SurfaceImageSource.  Note that compared to Desktop/Win7, this technique involves no additional copies, but rather moves the copy step from OS code into app code.

    -Jeff


    Jeff Sanders (MSFT)

    Jeff,

    Do you have a working example on your approach? I've tried it with Metro SwapChain based interop solution, and it works pretty well, but not shared surface like SurfaceImageSource.

    If this is not a supported scenario, then the MSDN documentation should be strengthened to mention this, otherwise it will waste lots of developers' valuable time.

    Thanks,

    MarcoZ


    Another Paradigm Shift! http://shevaspace.blogspot.com

    Wednesday, May 22, 2013 10:24 AM