resolving DepthStencil-Buffer in D3D10 / D3D10.1 / D3D11

Started by
2 comments, last by stoneMcClane 12 years, 9 months ago
Hi,

I didn't manage to find a satisfying answer on the webs, therefore I thought I'd ask here to make it clear for me and everyone who might be in the same premise in future.

Browsing through several papers/presentations I found no definite answer on the question if it is possible to resolve a multisampled DepthStencil-Buffer using ResolveSubresource. Some contained hints that this might be possible in D3D10.1 but not in D3D10, but I've yet to find any code snippet / sample on the web that actually does that. I've only found people doing the resolve in HLSL via binding the MSAA DepthStencil-Buffer as a Texture2DMS in their shaders. Is this the only way to resolve a MSAA DepthStencilBuffer or can this be done from code somehow as well ??

At least when I tried to use ResolveSubresource on my MSAA DepthStencil-Buffer with an D3D10.1 device in my code, the debug log told me that the source parameter of ResolveSubresource can't have the BIND_DEPTH_STENCIL flag set.

Currently I'm under the impression that it is like follows:

D3D10 ... can't use ResolveSubresource on DepthBuffer / can't access MSAA DepthBuffer directly from HLSL ... i.e. you must Render depth values to a texture on your own
D3D10.1 ... still can't use ResolveSubresource on DepthBuffer / CAN access MSAA DepthBuffer directly from HLSL ... via Texture2DMS.Load(...)
D3D11 ... I have no clue if anything has changed from D3D10.1 ... ???



I'd be really thankful if someone could shed some light on the situation and correct / complete the above listing, what are the possible ways to resolve an MSAA DepthStencil-Buffer in D3D10 / D3D10.1 / D3D11 ??
Cheers
Advertisement
Yes, what you wrote is true.
D3D10 can not access individual msaa DepthBuffer samples.
D3D10.1/D3D11 can access in hlsl, don't know about ResolveSubresource.

Here's D3D10.1 source code example from Humus that accesses individual msaa samples in DepthBuffer: http://humus.name/index.php?page=3D&ID=81

About ResolveSubresource - I believe this table can help: http://msdn.microsoft.com/en-us/library/ff471325%28v=vs.85%29.aspx
It lists what operations you can do on specific resource formats. You are interested in column 35.
As far as I can see - no depth format supports that.
As far as I know, if you want to resolve an MSAA depth-stencil buffer you must do it manually in a pixel shader (which you can only do in feature level 10.1 and 11).
Thanks for the confirmations ...
I hope this thread will help someone in future, since I've spent quite some time trying to figure out these facts :)

This topic is closed to new replies.

Advertisement