Stefan Dösinger : wined3d: Pitch alignment for the pow2Size.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Oct 6 06:27:56 CDT 2006


Module: wine
Branch: master
Commit: 6bcc5ae9f75ce4adc8650329f76b5aff7d654cdd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6bcc5ae9f75ce4adc8650329f76b5aff7d654cdd

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu Oct  5 21:38:00 2006 +0200

wined3d: Pitch alignment for the pow2Size.

---

 dlls/wined3d/device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 3ad28f8..13ea67a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1053,7 +1053,8 @@ static HRESULT  WINAPI IWineD3DDeviceImp
 
     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;




More information about the wine-cvs mailing list