From 6bcc5ae9f75ce4adc8650329f76b5aff7d654cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Thu, 5 Oct 2006 21:38:00 +0200 Subject: [PATCH] wined3d: Pitch alignment for the pow2Size. --- dlls/wined3d/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3ad28f84cbd..13ea67a8b8c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1053,7 +1053,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, U if (WINED3DFMT_UNKNOWN != Format) { object->bytesPerPixel = tableEntry->bpp; - object->pow2Size = (pow2Width * object->bytesPerPixel) * pow2Height; + object->pow2Size = ((pow2Width * object->bytesPerPixel) + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1); + object->pow2Size *= pow2Height; } else { object->bytesPerPixel = 0; object->pow2Size = 0;