Original Post
GetRenderTargetData is giving me surface which looks partially "cut off" (see outLockSurf_other.jpg). I'm rendering to the back buffer and another surface, and putting the render target data in a lockable surface. The problem only occurs when I'm getting data from the other surface. Everything is fine when I use the back buffer. Here's the code, with the (hopefully) unimportant stuff removed: This gives a "correct" outFinalSurf.jpg, and a cut off outLockSurf.jpg (shown in outLockSurf_other.jpg). If the problem-creating line (marked with a comment) in the code is replaced with this, all output is correct: So now outFinalSurf.jpg matches outLockSurf.jpg (shown in outLockSurf_back.jpg), and both are the way they're supposed to look. Also, there is no problem either way when the image is 1024x1024 pixels. The uploaded pictures were originally output at 2048x2048, and when larger images are used (like 4096x4096) more than 50% of the image is cut off. Does anybody know why this is happening? Images: outFinalSurf.jpg
outLockSurf_other.jpg
outLockSurf_back.jpg
// "finalTex" is the texture to which the other surface is attached
D3DDev->CreateTexture( width, height, 1, D3DUSAGE_RENDERTARGET,
D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &finalTex, 0 );
// "lockTex" is the texture to which the lockable surface is attached
D3DDev->CreateTexture( width, height, 1, 0,
D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &lockTex, 0 );
/* ...rendering stuff... */
// Setting up the targets for the final render pass
D3DDev->SetRenderTarget(0, D3DBackBuffer);
finalTex->GetSurfaceLevel(0, &finalSurf);
D3DDev->SetRenderTarget(1, finalSurf);
/* ...final render pass... */
// Put render data in the lockable surface
lockTex->GetSurfaceLevel(0, &lockSurf);
finalTex->GetSurfaceLevel(0, &finalSurf); // using this render target creates the problem
D3DDev->GetRenderTargetData(finalSurf, lockSurf);
// Save the surfaces to a file for proof
D3DXSaveSurfaceToFile(L"outFinalSurf.jpg", D3DXIFF_JPG, finalSurf, NULL, NULL);
D3DXSaveSurfaceToFile(L"outLockSurf.jpg", D3DXIFF_JPG, lockSurf, NULL, NULL);
D3DDev->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &finalSurf);
outLockSurf_other.jpg
outLockSurf_back.jpg