Commit 5864d18c authored by Markus Amsler's avatar Markus Amsler Committed by Alexandre Julliard

wined3d: Use SURFACE_ALIGNMENT.

parent 02cd4c85
...@@ -1842,7 +1842,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) { ...@@ -1842,7 +1842,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface) {
/* Stick to the alignment for the converted surface too, makes it easier to load the surface */ /* Stick to the alignment for the converted surface too, makes it easier to load the surface */
outpitch = width * bpp; outpitch = width * bpp;
outpitch = (outpitch + 3) & ~3; outpitch = (outpitch + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1);
mem = HeapAlloc(GetProcessHeap(), 0, outpitch * height); mem = HeapAlloc(GetProcessHeap(), 0, outpitch * height);
if(!mem) { if(!mem) {
...@@ -2126,7 +2126,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM ...@@ -2126,7 +2126,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, WINED3DFORM
format == WINED3DFMT_DXT4 || format == WINED3DFMT_DXT5) { format == WINED3DFMT_DXT4 || format == WINED3DFMT_DXT5) {
This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4)); This->resource.size = ((max(This->pow2Width, 4) * formatEntry->bpp) * max(This->pow2Height, 4));
} else { } else {
This->resource.size = ((This->pow2Width * formatEntry->bpp) + 3) & ~3; This->resource.size = ((This->pow2Width * formatEntry->bpp) + SURFACE_ALIGNMENT - 1) & ~(SURFACE_ALIGNMENT - 1);
This->resource.size *= This->pow2Height; This->resource.size *= This->pow2Height;
} }
......
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