5

I am trying to get MSAA in DX11 using D3DImage, but is seems, it is not possible, since shared multisampling texture are not allowed, as stated here: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476531(v=vs.85).aspx

Actually, I use the SharpDX implementation of the D3DImage, which works fine for DX11 and DX10 as long one can leave without anti alisasing.

Approaches to solve it are described in this thread: http://sharpdx.org/forum/5-api-usage/1000-d3d11-problem-with-usage-of-texture2d which are not successful. There is yet another thread asking a similar question: Multisampling and Direct3D10 / D3DImage interop

Finally, the question is in fact, if anyone can confirm, that it is definitly NOT possible to use D3DImage for rendering of anti-aliased content from DX10/DX11?

Community
  • 1
  • 1
DerPrzem
  • 133
  • 2
  • 6

1 Answers1

6

As said in the microsoft link (tried several times as well), multisampled shared textures are not allowed (actually texture must also have no mip level(s), as additional info)

The only way to share the texture is to create a non multisampled version (same format/parameters), then use

 DeviceContext.ResolveSubresource

in SharpDX to convert the msaa texture into a non multisampled one, then you can share the result of that.

mrvux
  • 8,523
  • 1
  • 27
  • 61
  • thanks. alright, but the question is, does it allow me to render using MSAA in DX11? I tried your suggested solution by creating a Texture2D with SampleDescription(4, 16), copying it with DeviceContext.ResolveSubresource and attaching the non-MS copy to D3DImage. But it does not help me to get an anti-aliased output in DX11... – DerPrzem Nov 06 '12 at 15:58
  • So you create MSAA Texture (with associated render target), render to MSAA render target, resolve MSAA texture to non multisampled one and result is not antialiased? – mrvux Nov 06 '12 at 16:16
  • 1
    Yes, it does. I found the error - I didn't set up the depth buffer to the same SampleDescription as the color buffer. Now it renders MSAA! Thanks for helping. – DerPrzem Nov 06 '12 at 17:32