diff options
author | Jakob Bornecrantz <[email protected]> | 2009-07-04 07:43:01 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-07-04 07:43:01 +0200 |
commit | 28471cfa970702128d822c2ecbb1703eedbca245 (patch) | |
tree | fa91f0d366ba857e228946ac88966e1717dc879f /src/gallium/auxiliary/util | |
parent | 9982821cdaf2205443c6297368eaab4115bf92f6 (diff) | |
parent | 71633abafc935c25da9731bab48c228ceb9b4097 (diff) |
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_tile.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 9747a55cbfa..a0c8ed88f74 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -1202,6 +1202,19 @@ pipe_put_tile_z(struct pipe_transfer *pt, } break; case PIPE_FORMAT_S8Z24_UNORM: + { + uint *pDest = (uint *) (map + y * pt->stride + x*4); + assert(pt->usage == PIPE_TRANSFER_READ_WRITE); + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { + /* convert 32-bit Z to 24-bit Z, preserve stencil */ + pDest[j] = (pDest[j] & 0xff000000) | ptrc[j] >> 8; + } + pDest += pt->stride/4; + ptrc += srcStride; + } + } + break; case PIPE_FORMAT_X8Z24_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); @@ -1216,13 +1229,26 @@ pipe_put_tile_z(struct pipe_transfer *pt, } break; case PIPE_FORMAT_Z24S8_UNORM: + { + uint *pDest = (uint *) (map + y * pt->stride + x*4); + assert(pt->usage == PIPE_TRANSFER_READ_WRITE); + for (i = 0; i < h; i++) { + for (j = 0; j < w; j++) { + /* convert 32-bit Z to 24-bit Z, preserve stencil */ + pDest[j] = (pDest[j] & 0xff) | (ptrc[j] & 0xffffff00); + } + pDest += pt->stride/4; + ptrc += srcStride; + } + } + break; case PIPE_FORMAT_Z24X8_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); for (i = 0; i < h; i++) { for (j = 0; j < w; j++) { /* convert 32-bit Z to 24-bit Z (0 stencil) */ - pDest[j] = ptrc[j] << 8; + pDest[j] = ptrc[j] & 0xffffff00; } pDest += pt->stride/4; ptrc += srcStride; |