Eliminated D3DXLoadSurfaceFromSurface from copyToRenderTarget.

TRAC #21621 Issue=311 Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1310 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4bb04bef
...@@ -1354,11 +1354,22 @@ bool Texture::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *sou ...@@ -1354,11 +1354,22 @@ bool Texture::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *sou
{ {
if (source && dest) if (source && dest)
{ {
HRESULT result; HRESULT result = D3DERR_OUTOFVIDEOMEMORY;
if (fromManaged) if (fromManaged)
{ {
result = D3DXLoadSurfaceFromSurface(dest, NULL, NULL, source, NULL, NULL, D3DX_FILTER_BOX, 0); D3DSURFACE_DESC desc;
source->GetDesc(&desc);
IDirect3DSurface9 *surf = 0;
result = getDevice()->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surf, NULL);
if (SUCCEEDED(result))
{
CopyLockableSurfaces(surf, source);
result = getDevice()->UpdateSurface(surf, NULL, dest, NULL);
surf->Release();
}
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment