wined3d: Use the resource size for copying between a surface's DIB and PBO.

This commit is contained in:
Henri Verbeet 2011-08-30 21:20:40 +02:00 committed by Alexandre Julliard
parent e7c523b135
commit dd462052c6
1 changed files with 3 additions and 5 deletions

View File

@ -1052,7 +1052,7 @@ static HRESULT surface_getdc(struct wined3d_surface *surface)
/* Sync the DIB with the PBO. This can't be done earlier because Map() /* Sync the DIB with the PBO. This can't be done earlier because Map()
* activates the allocatedMemory. */ * activates the allocatedMemory. */
if (surface->flags & SFLAG_PBO) if (surface->flags & SFLAG_PBO)
memcpy(surface->dib.bitmap_data, surface->resource.allocatedMemory, surface->dib.bitmap_size); memcpy(surface->dib.bitmap_data, surface->resource.allocatedMemory, surface->resource.size);
return hr; return hr;
} }
@ -3813,11 +3813,9 @@ HRESULT CDECL wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc)
return WINEDDERR_NODC; return WINEDDERR_NODC;
} }
/* Copy the contents of the DIB over to the PBO. */
if ((surface->flags & SFLAG_PBO) && surface->resource.allocatedMemory) if ((surface->flags & SFLAG_PBO) && surface->resource.allocatedMemory)
{ memcpy(surface->resource.allocatedMemory, surface->dib.bitmap_data, surface->resource.size);
/* Copy the contents of the DIB over to the PBO. */
memcpy(surface->resource.allocatedMemory, surface->dib.bitmap_data, surface->dib.bitmap_size);
}
/* We locked first, so unlock now. */ /* We locked first, so unlock now. */
wined3d_surface_unmap(surface); wined3d_surface_unmap(surface);