diff options
author | José Fonseca <[email protected]> | 2009-03-27 20:23:16 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-03-27 20:23:16 +0000 |
commit | a7900748106a9ad339a4552ca944f2fa30486cfc (patch) | |
tree | 7dc7b9628b2ab1dc98fae8eabfafa4f2aa144e13 /src/gallium/auxiliary/util | |
parent | e0a55dc9dae39384c18dd275081c24b7dce14eeb (diff) |
util: Support Z24S8/Z24X8.
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r-- | src/gallium/auxiliary/util/u_tile.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index d31ca9c029e..f0a5a339eb3 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -957,6 +957,7 @@ pipe_tile_raw_to_rgba(enum pipe_format format, s8z24_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: z24s8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; case PIPE_FORMAT_Z32_FLOAT: @@ -1069,6 +1070,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, /*s8z24_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_Z24X8_UNORM: /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; default: @@ -1198,6 +1200,20 @@ pipe_put_tile_z(struct pipe_transfer *pt, } } break; + case PIPE_FORMAT_Z24S8_UNORM: + 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 += pt->stride/4; + ptrc += srcStride; + } + } + break; case PIPE_FORMAT_Z16_UNORM: { ushort *pDest = (ushort *) (map + y * pt->stride + x*2); |