Fixed support for updating from managed surfaces.

TRAC #21621 Issue=311 Signed-off-by: Daniel Koch Author: Nicolas Capens (Fixes XP path that was broken in r1308) git-svn-id: https://angleproject.googlecode.com/svn/trunk@1313 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2e38b800
...@@ -325,10 +325,30 @@ void Image::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint y ...@@ -325,10 +325,30 @@ void Image::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint y
rect.right = xoffset + width; rect.right = xoffset + width;
rect.bottom = yoffset + height; rect.bottom = yoffset + height;
// UpdateSurface: source must be SYSTEMMEM, dest must be DEFAULT pools
POINT point = {rect.left, rect.top}; POINT point = {rect.left, rect.top};
HRESULT result = getDevice()->UpdateSurface(sourceSurface, &rect, destSurface, &point);
ASSERT(SUCCEEDED(result)); if (mD3DPool == D3DPOOL_MANAGED)
{
D3DSURFACE_DESC desc;
sourceSurface->GetDesc(&desc);
IDirect3DSurface9 *surf = 0;
HRESULT result = getDevice()->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surf, NULL);
if (SUCCEEDED(result))
{
CopyLockableSurfaces(surf, sourceSurface);
result = getDevice()->UpdateSurface(surf, &rect, destSurface, &point);
ASSERT(SUCCEEDED(result));
surf->Release();
}
}
else
{
// UpdateSurface: source must be SYSTEMMEM, dest must be DEFAULT pools
HRESULT result = getDevice()->UpdateSurface(sourceSurface, &rect, destSurface, &point);
ASSERT(SUCCEEDED(result));
}
} }
} }
...@@ -1197,7 +1217,6 @@ void GenerateMip(IDirect3DSurface9 *destSurface, IDirect3DSurface9 *sourceSurfac ...@@ -1197,7 +1217,6 @@ void GenerateMip(IDirect3DSurface9 *destSurface, IDirect3DSurface9 *sourceSurfac
ASSERT(SUCCEEDED(result)); ASSERT(SUCCEEDED(result));
ASSERT(sourceDesc.Format == destDesc.Format); ASSERT(sourceDesc.Format == destDesc.Format);
ASSERT(sourceDesc.Pool == destDesc.Pool);
ASSERT(sourceDesc.Width == 1 || sourceDesc.Width / 2 == destDesc.Width); ASSERT(sourceDesc.Width == 1 || sourceDesc.Width / 2 == destDesc.Width);
ASSERT(sourceDesc.Height == 1 || sourceDesc.Height / 2 == destDesc.Height); ASSERT(sourceDesc.Height == 1 || sourceDesc.Height / 2 == destDesc.Height);
......
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