Henri Verbeet : wined3d: Round up to complete compressed blocks in IWineD3DDeviceImpl_UpdateSurface ().
Module: wine Branch: master Commit: b20df2a24c369951532dbcefbd80e7c4fb9607da URL: http://source.winehq.org/git/wine.git/?a=commit;h=b20df2a24c369951532dbcefbd... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Aug 15 23:21:48 2010 +0200 wined3d: Round up to complete compressed blocks in IWineD3DDeviceImpl_UpdateSurface(). This is mostly an issue for surfaces with dimensions smaller than their format's block width/height. --- dlls/wined3d/device.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 81e63ff..b9948ab 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5304,9 +5304,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, if (dst_format->Flags & WINED3DFMT_FLAG_COMPRESSED) { - UINT row_length = (update_w / src_format->block_width) * src_format->block_byte_count; - UINT row_count = update_h / src_format->block_height; - UINT src_pitch = IWineD3DSurface_GetPitch(src_surface); + UINT row_length = wined3d_format_calculate_size(src_format, 1, update_w, 1); + UINT row_count = (update_h + src_format->block_height - 1) / src_format->block_height; + UINT src_pitch = wined3d_format_calculate_size(src_format, 1, src_w, 1); if (src_rect) {
participants (1)
-
Alexandre Julliard