OSDN Git Service

llvmpipe: keep texture stride 16byte aligned
authorKeith Whitwell <keithw@vmware.com>
Sun, 23 Aug 2009 11:07:36 +0000 (12:07 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sat, 29 Aug 2009 08:21:41 +0000 (09:21 +0100)
Fixes crash when resizing gears window.

src/gallium/drivers/llvmpipe/lp_texture.c

index 18c2362..169fe87 100644 (file)
@@ -76,7 +76,7 @@ llvmpipe_texture_layout(struct pipe_screen *screen,
       pt->depth[level] = depth;
       pt->nblocksx[level] = pf_get_nblocksx(&pt->block, width);  
       pt->nblocksy[level] = pf_get_nblocksy(&pt->block, height);  
-      lpt->stride[level] = pt->nblocksx[level]*pt->block.size;
+      lpt->stride[level] = align(pt->nblocksx[level]*pt->block.size, 16);
 
       lpt->level_offset[level] = buffer_size;