From 1bb4b7ece78140fff51dd9d41e393221f71f8105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Mon, 15 Feb 2016 18:18:06 +0100 Subject: [PATCH] wined3d: Remove the DIB extra line hack. Our surface pitch alignment should take care of any writes past unaligned widths. Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/surface.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index a335a82e8b4..c1d7b18f4ca 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -361,9 +361,7 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface) const struct wined3d_format *format = surface->resource.format; unsigned int format_flags = surface->container->resource.format_flags; unsigned int row_pitch, slice_pitch; - SYSTEM_INFO sysInfo; BITMAPINFO *b_info; - int extraline = 0; DWORD *masks; TRACE("surface %p.\n", surface); @@ -396,24 +394,11 @@ HRESULT surface_create_dib_section(struct wined3d_surface *surface) if (!b_info) return E_OUTOFMEMORY; - /* Some applications access the surface in via DWORDs, and do not take - * the necessary care at the end of the surface. So we need at least - * 4 extra bytes at the end of the surface. Check against the page size, - * if the last page used for the surface has at least 4 spare bytes we're - * safe, otherwise add an extra line to the DIB section. */ - GetSystemInfo(&sysInfo); - if( ((surface->resource.size + 3) % sysInfo.dwPageSize) < 4) - { - extraline = 1; - TRACE("Adding an extra line to the DIB section.\n"); - } - b_info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - /* TODO: Is there a nicer way to force a specific alignment? (8 byte for ddraw) */ wined3d_texture_get_pitch(surface->container, surface->texture_level, &row_pitch, &slice_pitch); b_info->bmiHeader.biWidth = row_pitch / format->byte_count; - b_info->bmiHeader.biHeight = 0 - surface->resource.height - extraline; - b_info->bmiHeader.biSizeImage = (surface->resource.height + extraline) * row_pitch; + b_info->bmiHeader.biHeight = 0 - surface->resource.height; + b_info->bmiHeader.biSizeImage = slice_pitch; b_info->bmiHeader.biPlanes = 1; b_info->bmiHeader.biBitCount = format->byte_count * 8;