Mesa (master): util: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOAT

Brian Paul brianp at kemper.freedesktop.org
Fri Jan 4 22:35:29 UTC 2013


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

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Jan  3 08:04:50 2013 -0700

util: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOAT

The Z32 pixel is 4 bytes so multiply x by 4, not 2.

Note: This is a candidate for the stable branches.

---

 src/gallium/auxiliary/util/u_tile.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c
index b3676de..6c618a6 100644
--- a/src/gallium/auxiliary/util/u_tile.c
+++ b/src/gallium/auxiliary/util/u_tile.c
@@ -801,7 +801,7 @@ pipe_put_tile_z(struct pipe_transfer *pt,
       break;
    case PIPE_FORMAT_Z32_FLOAT:
       {
-         float *pDest = (float *) (map + y * pt->stride + x*2);
+         float *pDest = (float *) (map + y * pt->stride + x*4);
          for (i = 0; i < h; i++) {
             for (j = 0; j < w; j++) {
                /* convert 32-bit integer Z to float Z */




More information about the mesa-commit mailing list