Mesa (master): r300g: fix alignement for NPOT values in hyperz setup

Marek Olšák mareko at kemper.freedesktop.org
Fri Mar 11 03:38:53 UTC 2011


Module: Mesa
Branch: master
Commit: b6c9c78bffe35d0ca9af100a1595412a1e06bd33
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6c9c78bffe35d0ca9af100a1595412a1e06bd33

Author: Nicolas Peninguy <nico at lostgeeks.org>
Date:   Thu Mar 10 21:48:44 2011 +0000

r300g: fix alignement for NPOT values in hyperz setup

With 3 pipes cards we need to align with NPOT values. This fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=32945

Signed-off-by: Nicolas Peninguy <nico at lostgeeks.org>

---

 src/gallium/drivers/r300/r300_texture_desc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
index 3846fb8..2910666 100644
--- a/src/gallium/drivers/r300/r300_texture_desc.c
+++ b/src/gallium/drivers/r300/r300_texture_desc.c
@@ -315,7 +315,7 @@ static unsigned r300_pixels_to_dwords(unsigned stride,
                                       unsigned height,
                                       unsigned xblock, unsigned yblock)
 {
-    return (align(stride, xblock) * align(height, yblock)) / (xblock * yblock);
+    return (util_align_npot(stride, xblock) * align(height, yblock)) / (xblock * yblock);
 }
 
 static void r300_setup_hyperz_properties(struct r300_screen *screen,
@@ -390,7 +390,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
                 tex->tex.zcomp8x8[i] = zcompsize == 8;
 
                 tex->tex.zmask_stride_in_pixels[i] =
-                    align(stride, zmask_blocks_x_per_dw[pipes-1] * zcompsize);
+                    util_align_npot(stride, zmask_blocks_x_per_dw[pipes-1] * zcompsize);
             } else {
                 tex->tex.zmask_dwords[i] = 0;
                 tex->tex.zcomp8x8[i] = FALSE;
@@ -398,7 +398,7 @@ static void r300_setup_hyperz_properties(struct r300_screen *screen,
             }
 
             /* Now setup HIZ. */
-            stride = align(stride, hiz_align_x[pipes-1]);
+            stride = util_align_npot(stride, hiz_align_x[pipes-1]);
             height = align(height, hiz_align_y[pipes-1]);
 
             /* Get the HIZ buffer size in dwords. */




More information about the mesa-commit mailing list