I'm wondering if it's possible to create 6 depth stencil surfaces for a cube depth map and then render
into them in the geometry shader in one pass using SV_RenderTargetArrayIndex.
I want to just bind the depth stencil part and not the render target part, since I'd like to disable color writes during shadow map generation, so there's no point in passing any render target.
I would do deviceContext->OMSetRenderTargets( ...,..., cubeDepthStencilMapView );
I would expect that if I do something like this in the geometry shader:
struct GS_OUTPUT{
float4 Pos : SV_Position;
uint cubeDepthMapIndex : SV_RenderTargetArrayIndex;
};
...
for( uint i=0;i<6;++i){
cubeDepthMapIndex = i;
}
...
It will index the correct depth stencil surface even if there is no render target bound ? ...
I can't think that I have to create 6 depth stencil view and 6 render target view when the only thing that I need is just depth (moreover, color writes disabled make the rendering faster).
Can anyone confirm this possibility ?
thanks a lot in advance













