
GPU Computing 213
unsigned int numSlices = csub . GetNumSlicesFor ( csub . le ve l ) ;
CopyPitched3(numRows , numSlices , sub . RowPitch , sub . DepthPitch ,
sub . pData , csub . rowPitch , csub . slicePi tch , csub . data ) ;
}
context−>Unmap( output . staging , s r i );
LISTING 4.62: Copy from GPU to CPU for a texture resource.
4.7.5 Copy from GPU to GPU
D3D11 has functions for GPU-to-GPU copy via the ID3D11DeviceContext
interfaces, CopyResource [36] and CopySubresourceRegion [37]. The main technical
problem is that you cannot copy between arbitrary formats. I had mentioned
previously in Section 4.4.7 about trying to copy from a depth-stencil texture ...