DepthStencil array

What is the use and the conditions of use of a DepthStencil array (SetDepthStencilArray) ?

Could someone also give an example of application?

Thanks.

[188 byte] By [PascalMignot] at [2008-3-6]
# 1

Well as the FX file could contain an array of depth stencil view objects you need such a function to set elements of this array.

RalfKornmann at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Direct3D 10...
# 2

Could you more specific, please?

This don't tell me:

  1. What is the practical use of a DepthStencil array?
  2. How to use it in an HLSL code?
  3. How to use it in an effect code?

The only clue that I've found is the D3D10_DSV_DIMENSION_TEXTURE2DMSARRAY type for a DepthStencil view which seems to indicate that DepthStencil arrays are only used with multisampling (I suppose, one per sample). In that case, is there a benefice of using an array rather than a single DepthStencil?

I suppose the idea could be to allow some specific post-processing using variations per sample in the DepthStencil?

Thanks.

PascalMignot at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Direct3D 10...
# 3
DepthStencil array used while rendering to TextureArray. This is demonstrated in CubeMapGS sample, while using geometry shader to render in different faces of CubeMap. In this sample used array of 6 DepthStencil surfaces - one for each face of CubeMap.
AlexeyBarkovoy at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Direct3D 10...
# 4

Consequently, SV_RenderTargetArrayIndex is also the index of the DepthStencil array.

So when using SV_RenderTargetArrayIndex, it should be compulsory to have the same size for the RenderTarget Array and the DepthStencil Array.

Right?

Thanks.

PascalMignot at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Direct3D 10...
# 5

Consequently, SV_RenderTargetArrayIndex is also the index of the DepthStencil array.

Yes

So when using SV_RenderTargetArrayIndex, it should be compulsory to have the same size for the RenderTarget Array and the DepthStencil Array.

OMSetRenderTargets() has only single NumViews parameter for two pointers (RenderTargetViews and DepthStencilView), so it's explicit.

AlexeyBarkovoy at 2007-9-4 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Direct3D 10...