开发者

How to improve the copy speed from D3D surface back to system memory

I'm using the following codes to copy D3D surface back to system memory, but the performance is bad when call LockRect operation, it spends lot of time of this function. Is there a way to improve it? Thanks in advance.

Below is sample codes.

D3DDev->GetRenderTargetData(renderTarget, offscreenSurface)开发者_开发技巧;

// Lock the surface to read pixels

offscreenSurface->LockRect( &lr, &rect, D3DLOCK_READONLY );


What D3D version? You can create a render target with HDC support, get it's surface and use surface->GetHDC() afterwards. I used this trick instead of 'LockRect', it gave acceptable performance for capturing D3D data to use with regular GDI or I/O.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜