Commit 2b8a7dca authored by Oliver Stieber's avatar Oliver Stieber Committed by Alexandre Julliard

Correct a problem with locking nonpower 2 back and front buffers.

parent f89c69c4
......@@ -285,7 +285,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
This->resource.format == WINED3DFMT_DXT4 || This->resource.format == WINED3DFMT_DXT5) /* DXT2/3/4/5 is 16 bytes per block */
pLockedRect->Pitch = (This->currentDesc.Width >> 2) << 4;
else {
if (NP2_REPACK == wined3d_settings.nonpower2_mode) {
if (NP2_REPACK == wined3d_settings.nonpower2_mode || This->resource.usage & D3DUSAGE_RENDERTARGET) {
/* Front and back buffers are always lockes/unlocked on currentDesc.Width */
pLockedRect->Pitch = This->bytesPerPixel * This->currentDesc.Width; /* Bytes / row */
} else {
pLockedRect->Pitch = This->bytesPerPixel * This->pow2Width;
......
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